Created
July 26, 2016 19:41
-
-
Save flatanimals/95096d9e505eed75f0f6a883680f067c to your computer and use it in GitHub Desktop.
Nginx GeoIP Filtering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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