Correct way to do redirect

Chris Savery chrissavery at gmail.com
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 127.0.0.1:9000; include 
fastcgi_params; }
    }
... other servers...


Thanks for any help with this.
Chris :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080830/9eedfe03/attachment.html>


More information about the nginx mailing list