Welcome! Log In Create A New Profile

Advanced

Re: geoip filtering not working

August 16, 2013 09:16AM
I have this working pretty well (ok, I think _very_well_ ) with GeoIP.

I used a MAP in the main nginx.conf like this:
map $geoip_country_code $allowed_country {
default 0;

US 1;
GB 1;
CA 1;
EU 1;
}

Then, in my default.conf, the first statement(s) in the relevant
"location's" is:

if ($allowed_country = 0) {
return 418;
}

Again, this works for me, and you can add "allowed countries" in just
one place: the "map".

-AJ

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

geoip filtering not working

bignginxfan July 12, 2013 10:08PM

Re: geoip filtering not working

Matt520 August 16, 2013 06:27AM

Re: geoip filtering not working

aweber August 16, 2013 09:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 303
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