Nginx load balancer with GeoIP

Igor Sysoev is at rambler-co.ru
Tue Nov 11 09:40:02 MSK 2008


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