Skip to content

Instantly share code, notes, and snippets.

@flatanimals
Created July 26, 2016 19:41
Show Gist options
  • Save flatanimals/95096d9e505eed75f0f6a883680f067c to your computer and use it in GitHub Desktop.
Save flatanimals/95096d9e505eed75f0f6a883680f067c to your computer and use it in GitHub Desktop.
Nginx GeoIP Filtering
##
# GeoIP Filtering
##
## dat files: wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
geoip_country /etc/nginx/geoip/GeoIP.dat;
geoip_city /etc/nginx/geoip/GeoLiteCity.dat;
map $geoip_country_code $allowed_country {
default no;
US yes;
CA yes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment