Skip to content

Commit 8d7724d

Browse files
committed
Added example of blacklisting a continent.
1 parent 2215a49 commit 8d7724d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ Follow these steps to enable the dbip mod:
4141
if ($lan-ip = yes) { set $geo-whitelist yes; }
4242
if ($geo-whitelist = no) { return 404; }
4343
44+
location / {
45+
```
46+
Or for blacklist with both some countries and continents:
47+
```nginx
48+
server {
49+
listen 443 ssl;
50+
listen [::]:443 ssl;
51+
52+
server_name some-app.*;
53+
include /config/nginx/ssl.conf;
54+
client_max_body_size 0;
55+
56+
if ($lan-ip = yes) { set $geo-blacklist yes; }
57+
if ($geo-blacklist = no) { return 404; }
58+
if ($continent-blacklist = no) { return 404; }
59+
4460
location / {
4561
```
4662
6. Restart the container to apply the changes.

root/defaults/dbip.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ map $geoip2_data_country_iso_code $geo-blacklist {
1919
# GB no;
2020
}
2121

22+
# Continents:
23+
24+
map $geoip2_data_continent_code $continent-blacklist {
25+
default yes;
26+
# Example blacklisting a continent, uncomment the blacklisted continent bellow
27+
# SA no; # South America
28+
}
29+
2230
geo $lan-ip {
2331
default no;
2432
10.0.0.0/8 yes;

0 commit comments

Comments
 (0)