GeoIP country blocking - whitelist specific IPs

Infinitnet nginx-forum at
Tue Nov 13 11:21:10 UTC 2012


thanks for your reply! Your solution does indeed make sense and I've been
using something similar before. Just thought there might be something that
wouldn't require rewriting my current syntax, such as:

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

Posted at Nginx Forum:,232745,232762#msg-232762

More information about the nginx mailing list