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

Simple Load Balancing on Windows

$
0
0
Hello everybody,
I'm new to Nginx and I followed the instructions on the website to setup a very simple Load Balancer.
I have a rest web service running on two servers on port 10002:
- server1.domain.com:10002/info
- server2.domain.com:10002/info

So I installed Nginx on a 3rd server (server3.domain.com) and setup the nginx.conf as follow:

upstream loadbal {
server server1.domain.com;
server server2.domain.com;
}

server {
listen 10002;

location / {
proxy_pass http://loadbal;
}
}

When I log on server3.domain.com and try to execute the following: localhost:10002/info
I would expect the request to be redirected to either server1 or server2.
Instead after a while it just times out.

In the error log I can see:
2016/06/02 10:07:45 [error] 6088#5796: *143 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /info HTTP/1.1", upstream: "http://<server2 IP address>:80/info", host: "localhost:10002"

I don't understand why it's trying to reach port 80 of server2.

I've also tried to change the config as follow, but didn't make any difference:
upstream loadbal {
server server1.domain.com:10002;
server server2.domain.com:10002;
}
Any idea?
Thank you!

Viewing all articles
Browse latest Browse all 4759

Trending Articles