mod_maxminddb
mod_maxminddb copied to clipboard
Clear example how to use maxminddb to allow traffic from specific countries with Require keyword in Apache
Since Apache 2.4 "Deny all" and alike are deprecated. This should be replaced by Require statements. However all documentation I can find mentions "deny all" and the like. I'm trying something simple: allow connection from specific set of countries. However whatever I do this doesn't seem to work properly.
SetEnvIf MM_COUNTRY_CODE ^(US|CA) AllowCountry
Require all denied
Require env AllowCountry
The opposite does seem to work.
<RequireAll>
Require not env BlockCountry
# Allow all other IP's
Require all granted
</RequireAll>
Where can I find a clear example that's certainly working? This seems like a very basic thing but I can't seem to get it to work properly.