I need advice to settings Nginx - nginx

I have to install two nginx in one VM. First one use 80 port and the other use other port(8080).
nginx#1(80 port) work successfully. But nginx#2(8080 port) cannot proxy to other server.
This is current settings.
Scenario #1 : http://10.10.10.10 -> http://10.10.10.10/app1(http://10.10.10.20:7010/app1) :: success
Scenario #2 : http://10.10.10.10/app -> http://10.10.10.10/app1(http://10.10.10.20:7010/app1) :: succes
Scenario #3 : http://10.10.10.10:8080 -> http://10.10.10.10/app1/app2 :: fail
What is the problem in Scenario#3? I want to move to http://10.10.10.10:8080(http://10.10.10.30:7010/app2).

Related

EUCA 4.4.5 VPCMIDO Instances Terminate at Launch

I have achieved a small test cloud on 3 pieces of hardware. It works fine when in EDGE mode but when I try to configure it for VPCMIDO, new instances begin to launch but then timeout and move to a terminated state. I can also see the instances' initial volume and config data appear in the NC and CC data directories. Below is my system layout and network.json.
HOST 1 : CLC/UFS/WALRUS/MIDO CLUSTER/MIDO GATEWAY/MIDOLMAN AGENT:
em1 (All Services including Mido Cluster): 10.0.0.21
em3 (Target VPCMIDO Adapter): 10.0.0.22
HOST 2 : CC/SC
em1 : 10.0.0.23
HOST 3 : NC/MIDOLMAN AGENT
em1 : 10.0.0.24
{
"Mido": {
"Gateways": [
{
"Ip": "10.0.0.22",
"ExternalDevice": "em3",
"ExternalCidr": "192.168.0.0/16",
"ExternalIp": "192.168.0.2",
"ExternalRouterIp": "192.168.0.1"
}
]
},
"Mode": "VPCMIDO",
"PublicIps": [
"10.0.100.1-10.0.100.254"
]
}
I may be misunderstanding the intent of reserving an interface just for the mido gateway. All of my eucalyptus/zookeeper/cassandra/midonet configs use the 10.0.0.21 interface and seem to communicate fine. The midonet tunnel zone reports my CLC host and NC host successfully in the tunnel zone. The only part of my config that references the interface I intend to use for the midonet gateway is the network.json. No errors were returned at any time during my config so I think I may be missing something conceptual.
You may need to start eucanetd as described here:
https://docs.eucalyptus.cloud/eucalyptus/4.4.5/index.html#install-guide/starting_euca_clc.html
The eucanetd component in vpcmido mode runs on the cloud controller and is responsible for controlling midonet.
When eucanetd is not running instances will fail to start as the required network resources will not be created.
I configured a bridge on the NC and instances were able to launch and I no longer got an error in my nc.log. Docs and the eucalyptus.conf file comments tell me I shouldn't need to do this in VPCMIDO netowrking mode: https://docs.eucalyptus.cloud/eucalyptus/4.4.5/index.html#install-guide/configuring_bridge.html
Despite all that adding the bridge fixed this issue.

Hosting multiple meteor apps on one server

I have 2 meteor apps running on one Ubuntu server on DO. I have also set up nginx for "servering"
Config files:
sailsadria.conf : http://pastebin.com/eCicpNxK
ytp.klancir.work.conf : http://pastebin.com/cNKtA0dV
Now...
http://sailsadria.com/ which is on port 3000 works smoothly as expected while http://ytp.klancir.work/ goes on ngnix root. On the other hand http://ytp.klancir.work:3010 goes to the right app that is working on that port (but I suppose that any URL or the IP i forward with the appended port will end up on the right location)
Symlinks are also set up
The domains are configured:
sailsadria: http://screencast.com/t/iqKUlQlDgj8
ytp.klancir.work: http://screencast.com/t/DJJdLfqna
I dont know how to set up that http://ytp.klancir.work/ goes directly to port 3010 in other words - directly to the app...
The SOLUTION: sudo service nginx restart....

Crate.io - failed to send join request to master

I am trying to connect two Crate.io nodes which are in different data centers. Node 1 is the master and is already running. When I try to get Node 2 to join the cluster I get the following error:-
[2016-06-23 09:29:30,475][INFO ][discovery.zen] [Node 2] failed to
send join request to master [[Node 1][flPMSe_vQw-2GEb5dkwqaw][ns1.example.com]
[inet[/11.22.33.44:4300]]{http_address=http://11.22.33.44:4200, master=true}],
reason [RemoteTransportException[[Node 1][inet[/11.22.33.44:4300]][internal:discovery
/zen/join]]; nested: ConnectTransportException[[Node 2][inet[/10.19.0.5:4300]]
connect_timeout[30s]]; nested: ConnectTimeoutException
[connection timed out: /10.19.0.5:4300]; ]
Any ideas?
yes, it seems like you have NAT between those data centers, which is why you need to set the publish host parameter to your public IP (where you have to have port mapping to this/these machine/s).
To fix this, set the publish_host setting in crate.yml and maybe (if required - depends on your port mapping settings) publish_port.
See here: https://crate.io/docs/reference/configuration.html#hosts
In crate.yml
network.publish_host: <ip address of Node 2>
service crate restart

How to found where DNS name is expected to resolve?

Does it possible to check which DNS server used for resolving domain name (in intraned network)? We have many steps: proxy, BigIP, domain controllers, etc.
I have a complicated networks with many DNS server. Sometimes when in browser I use:
http://mysitedomainalias.mydomain.com
I receive web page,
sometime after near 15 minutes I receive error about timeout.
But when I use IP address instead of domain alias I always reach my web page.
So I have decided that it could be a problem with DNS server. I would like to know common way how to resolve similar problems.
On *NIX systems, dig is a standard tool to test and debug DNS servers:
deceze$ dig google.com
...
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 5 IN A 173.194.35.168
google.com. 5 IN A 173.194.35.161
google.com. 5 IN A 173.194.35.169
...
;; Query time: 84 msec
;; SERVER: 192.168.10.1#53(192.168.10.1)
;; WHEN: Mon Jul 14 15:59:05 2014
;; MSG SIZE rcvd: 204
In the last part, SERVER signifies which DNS server answered our request.
Some more things you can then do with dig:
query a specific DNS server instead of the system's default:
$ dig #mydns.example.com google.com
trace each step of the resolution chain to see any problems in the canonical name servers:
$ dig google.com +trace
query specific record types:
$ dig google.com NS
$ dig google.com MX
$ dig google.com ANY
See the manual: http://linux.die.net/man/1/dig

Using NGrok with POW

I've almost got NGrok working with POW, but it is resolving to the POW without drilling down to the application running on POW.
I can access my local application running on POW at:
myapp.dev
However when I initialize Ngrok:
/Applications/ngrok -subdomain=myapp myapp.dev:80
As outlined here, I receive the following output from NGrok:
Tunnel Status online
Version 1.6/1.5
Forwarding http://myapp.ngrok.com -> 127.0.0.1:80
Forwarding https://myapp.ngrok.com -> 127.0.0.1:80
Web Interface 127.0.0.1:4040
# Conn 0
Avg Conn Time 0.00ms
Loading http://myapp.ngrok.comresolves to POW, but I get the generic message:
Pow is installed
You’re running version 0.4.1
How can I setup NGrok to resolve to my .dev domain?
Might be a bit late to the party, but here it goes.
It seems like you need to modify your Host header.
For example:
ngrok http -host-header=myapp.dev mayapp.dev:80
This answer only works with ngrok v2.
More info can be found at https://ngrok.com/docs#http
I was using the Powder gem and doing "powder restart", which only works for the local site. You might need to restart pow as described in the manual: http://pow.cx/manual.html#section_3.3

Resources