Welcome! Log In Create A New Profile

Advanced

Basic nginx configuration problem

Posted by LilNooblet 
Basic nginx configuration problem
March 21, 2017 10:43AM
Hi!

I'm new to whole nginx thing and trying to figure out how to get this thing work. Here's the what:

- 1 DNS
- 2 nginx servers
- 1 app server

and why:

Nginx is supposed to be used to load balance traffic coming from internet and redirect it to app server. At this moment there is only 1 app server because I wanted to simplify things and get things to work first. Later there are supposed to be 2 app servers.

Anyway, app server name is advertised(not sure if correct word) to DNS. DNS record points to nginx load balancers. Load balancer points to app server and to a specific port.

- I've made sure that DNS setting is correct. Using nslookup to query DNS name of app server I get 2 different IPs (=nginx server IPs).

- Nginx config is very simple, here's the code (same in both nginx servers):
--- BEGIN ---
upstream SERVER_NAME {
server IP:PORT;
}

server {
listen 80;

location / {
proxy_pass http://SERVER_NAME;
}
}
--- END ---
^ that server IP is the app servers IP

- I've tried telnetting from nginx servers to app server port and established successfully connection.

- I've checked that the app is running in the app server.

So all in all, everything seems to be working OK, except it is not. When I try to use browser (Chrome, Firefox, Edge) and navigate to servers page I get "site not found" error. I really can't figure out where I went wrong. Also when checked nginx log files I get no indication of successful connection to server.

Any and all help would be GREATLY appreciated. Thanks in advance!
Re: Basic nginx configuration problem
March 23, 2017 07:44AM
Hi,is that an http upstream,yes?
How do you usually call your application?(uri,parameters,or ip?)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready