Welcome! Log In Create A New Profile

Advanced

Re: Load balancing, missing a detail...

Sergej Kandyla
March 23, 2009 12:56PM
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;
}
}
}
Subject Author Posted

Load balancing, missing a detail...

Floren Munteanu March 23, 2009 12:37PM

Re: Load balancing, missing a detail...

Sergej Kandyla March 23, 2009 12:56PM

Re: Load balancing, missing a detail...

Floren Munteanu March 23, 2009 01:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready