# The below config is for geoblocking any country/city you add. The default config is blocking all countries/cities except the ones you set to "yes".
# If you want to do the opposite, set default to "yes", and the countries/cities to "no".
# As the default config blocks all IP's except the ones in the GeoLite2-City.mmdb database set to yes, you will need to allow your lan ip for local access.
geoip2 /config/geoip2db/GeoLite2-City.mmdb {
auto_reload 5m;
$geoip2_data_country_code country iso_code;
$geoip2_data_city_name city names en;
}
# GEOIP2 COUNTRY CONFIG
map $geoip2_data_country_code $allowed_country {
default no;
<COUNTRY-CODE> yes; # e.g GB yes; for United Kingdom
IP/CIDR yes; # e.g. 192.168.1.0/24 yes; for local access.
}
#(Optional)
# GEOIP2 CITY CONFIG
# map $geoip2_data_city_name $allowed_city {
# default no;
# <CITY-NAME> yes; # e.g Inverness yes;
# IP/CIDR yes; # e.g. 192.168.1.0/24 yes; for local access.