Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Basic nginx configuration problem

$
0
0
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!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>