Skip to content

Commit ba39fe3

Browse files
authored
Merge pull request #1055 from TheMihle/swag-dbip
2 parents 2215a49 + c7d3981 commit ba39fe3

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ map $geoip2_data_country_iso_code $geo-blacklist {
1919
# GB no;
2020
}
2121

22+
# Continents:
23+
# Options: AF, AS, EU, NA, OC, SA, AN
24+
25+
map $geoip2_data_continent_code $continent-blacklist {
26+
default yes;
27+
# Example blacklisting a continent, uncomment the blacklisted continent bellow
28+
# SA no; # South America
29+
}
30+
2231
geo $lan-ip {
2332
default no;
2433
10.0.0.0/8 yes;

0 commit comments

Comments
 (0)