From 8d7724d28679900d2e484ca55041aec7a743b565 Mon Sep 17 00:00:00 2001 From: Mihle Date: Thu, 14 Aug 2025 21:35:30 +0200 Subject: [PATCH 1/2] Added example of blacklisting a continent. --- README.md | 16 ++++++++++++++++ root/defaults/dbip.conf | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index b127e57c3..64b49abc0 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,22 @@ Follow these steps to enable the dbip mod: if ($lan-ip = yes) { set $geo-whitelist yes; } if ($geo-whitelist = no) { return 404; } + location / { + ``` + Or for blacklist with both some countries and continents: + ```nginx + server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name some-app.*; + include /config/nginx/ssl.conf; + client_max_body_size 0; + + if ($lan-ip = yes) { set $geo-blacklist yes; } + if ($geo-blacklist = no) { return 404; } + if ($continent-blacklist = no) { return 404; } + location / { ``` 6. Restart the container to apply the changes. diff --git a/root/defaults/dbip.conf b/root/defaults/dbip.conf index 3a48efbab..e2e2e58df 100644 --- a/root/defaults/dbip.conf +++ b/root/defaults/dbip.conf @@ -19,6 +19,14 @@ map $geoip2_data_country_iso_code $geo-blacklist { # GB no; } +# Continents: + + map $geoip2_data_continent_code $continent-blacklist { + default yes; + # Example blacklisting a continent, uncomment the blacklisted continent bellow + # SA no; # South America +} + geo $lan-ip { default no; 10.0.0.0/8 yes; From c7d3981943671d533e02d350faef361c0ff85fe6 Mon Sep 17 00:00:00 2001 From: Mihle Date: Fri, 15 Aug 2025 11:07:20 +0200 Subject: [PATCH 2/2] Added the possible continent options to dbip.conf Signed-off-by: Mihle --- root/defaults/dbip.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/root/defaults/dbip.conf b/root/defaults/dbip.conf index e2e2e58df..80a8dbb76 100644 --- a/root/defaults/dbip.conf +++ b/root/defaults/dbip.conf @@ -20,6 +20,7 @@ map $geoip2_data_country_iso_code $geo-blacklist { } # Continents: +# Options: AF, AS, EU, NA, OC, SA, AN map $geoip2_data_continent_code $continent-blacklist { default yes;