Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions root/defaults/dbip.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down