Correct way to do redirect

Chris Savery chrissavery at
Sat Aug 30 02:28:25 MSD 2008

I'd like to do a geo based redirect. Users who initially hit my site 
would be given an IP round robin from the  DNS servers. Then each node 
would test the ip and decide if it would be better to redirect to the 
closer node. Only doing this for index.php, eg.

http {
    geo $region {
        default NA;
        include georegions.conf;

server {
           location ~ ^/index.php {
               if ($region = NA)
 --> what to write here to redirect to other IP?
        location ~ \.php$ { fastcgi_pass; include 
fastcgi_params; }
... other servers...

Thanks for any help with this.
Chris :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list