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..80a8dbb76 100644 --- a/root/defaults/dbip.conf +++ b/root/defaults/dbip.conf @@ -19,6 +19,15 @@ map $geoip2_data_country_iso_code $geo-blacklist { # GB no; } +# Continents: +# Options: AF, AS, EU, NA, OC, SA, AN + + 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;