Geoip redirect but exclude a specific directory

st1905 nginx-forum at nginx.us
Tue Nov 23 20:27:17 MSK 2010


Tried 

location ~ ^/admin/.+\.php$ {

fastcgi_pass   127.0.0.1:9000;
root  /var/www/vhosts/domain.com/httpdocs;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_index  index.php;
include        fastcgi_params;
break;
}

if ($mygeo = "1") {
break;

}

if ($geoip_country_code = "DE") {
   rewrite ^(.*)$ http://de.domain.com permanent;

                                               }

Still someone with ip from germany cant access the admin section, what
i`m doing wrong here ?

Thanks.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,152469,152716#msg-152716




More information about the nginx mailing list