Welcome! Log In Create A New Profile

Advanced

GeoIP country blocking - whitelist specific IPs

November 12, 2012 03:02PM
Hello NGINX users,

I'm facing a little issue with country bans over GeoIP. I'm using the following code within my server directive:

if ($geoip_country_code ~ (BR|CN|KR|RU) ) {
return 123;
}

123 returns an error page informing the visitor that his country is blocked. Now let's say I've got some visitors from russia, who should still be able to access my website. How would I archive this? Of course something like "allow 1.2.3.4;" doesn't work with the code above. Any suggestions?

Thanks in advance!
SubjectAuthorPosted

GeoIP country blocking - whitelist specific IPs

InfinitnetNovember 12, 2012 03:02PM

Re: GeoIP country blocking - whitelist specific IPs

Lasse LaursenNovember 13, 2012 06:04AM

Re: GeoIP country blocking - whitelist specific IPs

InfinitnetNovember 13, 2012 06:21AM

Re: GeoIP country blocking - whitelist specific IPs

InfinitnetNovember 13, 2012 06:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready