- Uses the MaxMind GeoIP2 database for country lookups.
- Download the
GeoLite2-Country.mmdb
file (see Installation). - Use
block_countries
orwhitelist_countries
with ISO country codes:
# Block requests from Russia, China, and North Korea
block_countries /path/to/GeoLite2-Country.mmdb RU CN KP
# Whitelist requests from the United States
whitelist_countries /path/to/GeoLite2-Country.mmdb US