Welcome! Log In Create A New Profile

Advanced

Geoip redirect but exclude a specific directory

November 22, 2010 03:34PM
Hello,

I`m using the method described in here to redirect people with specific ips to locations

[code]
http {
keepalive_timeout 65;
geoip_country /usr/local/etc/geo/GeoIP.dat ;

# these are the GeoIP exceptions for your site
geo $mygeo {
default 0;
bla/19 1;
blu/16 1;
}


then, in the server block:

location / {
include proxy-lcb-lt.conf;
if ($geoip_country_code = "US") {
proxy_pass http://prod;
}
# these are the exceptions, defined in nginx.conf:
if ($mygeo = "1") {
proxy_pass http://prod;
}
}
[/code]


Problem is the administrator of the site is from one of the countries that gets redirected so he cant access the administration section of the site instead he gets redirected to another place.

How can i exclude the directory "admin" from the above geoip redirection ?

Thanks for any suggestion.

http://www.somerorbay.com
Subject Author Posted

Geoip redirect but exclude a specific directory

st1905 November 22, 2010 03:34PM

Re: Geoip redirect but exclude a specific directory

Maxim Dounin November 22, 2010 04:52PM

Re: Geoip redirect but exclude a specific directory

st1905 November 23, 2010 12:27PM

Re: Geoip redirect but exclude a specific directory

Rainer Duffner November 23, 2010 01:30PM

Re: Geoip redirect but exclude a specific directory

st1905 November 23, 2010 01:49PM

Re: Geoip redirect but exclude a specific directory

st1905 November 24, 2010 07:49AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 223
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready