mod_maxminddb icon indicating copy to clipboard operation
mod_maxminddb copied to clipboard

Clear example how to use maxminddb to allow traffic from specific countries with Require keyword in Apache

Open th3penguinwhisperer opened this issue 10 months ago • 0 comments

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.

th3penguinwhisperer avatar Apr 03 '25 19:04 th3penguinwhisperer