Nginx load balancer with GeoIP

Glen Lumanau glen at lumanau.web.id
Tue Nov 11 10:19:14 MSK 2008


How do I spread connection if I use
./geo2nginx.pl GeoIPCountryWhois.csv > geo.conf


Regards,

Glen Lumanau


-----Original Message-----
From: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] On Behalf Of Igor
Sysoev
Sent: 11 Nopember 2008 13:40
To: nginx at sysoev.ru
Subject: Re: Nginx load balancer with GeoIP

On Tue, Nov 11, 2008 at 10:10:42AM +0700, Glen Lumanau wrote:

> Is nginx will support load balancing with GeoIP support?
> 
>  
> 
> Example :
> 
> If match country US
> 
>                 Proxy_pass http://us.server/;
> 
> If match other
> 
>                 Proxy_pass http://default.server/;

http {
      geo  $geo  {
         default      default;
         1.1.1.0/24   us;
         1.1.2.0/24   us;
         1.1.3.0/24   us;
         ...
      }

      upstream  us.server {
          ....
      }

      upstream  default.server {
          ....
      }

      server {
           location / {
               proxy_pass  http://$geo.server;
           }


-- 
Igor Sysoev
http://sysoev.ru/en/






More information about the nginx mailing list