Load balancing, missing a detail...

Sergej Kandyla sk.paix at gmail.com
Mon Mar 23 19:31:29 MSK 2009


Floren Munteanu пишет:
> Hi all,
>
> I need your help with setting nginx as load balancer.
> I have 2 servers, 192.168.1.2 (Web1) and 192.168.1.3 (Web2), both with
> same content into /www/html directory.
> Web1 has nginx installed.
>
>   
Did you read this http://wiki.nginx.org/NginxHttpUpstreamModule ?

>
> What am I missing? Do I need to install another software, like
> TurboGears?
>   
No.

> All I want is to load balance 2 servers who have the exact same
> content...
>
> I looked at this example:
> http://wiki.nginx.org/NginxLoadBalanceExample
>
> If I visit http://192.168.1.2:80/, I can see the site. Not if I go to
> http://192.168.1.2:8000/...
>   

You should define a real ports of your backends in the nginx configuration.
i.e.

http {
upstream backends {
server 192.168.1.2:80;
server 192.168.1.3:80;
}

server {
listen 80;
server_name www.domain.com;
location / {
proxy_pass http://mbackends;
}
}
}






More information about the nginx mailing list