File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff 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 ```
46626. Restart the container to apply the changes.
Original file line number Diff line number Diff 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+
2230geo $lan-ip {
2331 default no;
2432 10.0.0.0/8 yes;
You can’t perform that action at this time.
0 commit comments