mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-18 18:07:22 +01:00
Merge changes from kiekerjan special
This commit is contained in:
22
conf/nginx/conf.d/10-geoblock.conf
Normal file
22
conf/nginx/conf.d/10-geoblock.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
# GeoIP databases
|
||||
geoip_country /usr/share/GeoIP/GeoIP.dat;
|
||||
geoip_city /usr/share/GeoIP/GeoIPCity.dat;
|
||||
|
||||
# map the list of denied countries
|
||||
# see e.g. https://dev.maxmind.com/geoip/legacy/codes/iso3166/ for allowable
|
||||
# countries
|
||||
map $geoip_country_code $denied_country {
|
||||
default yes;
|
||||
}
|
||||
|
||||
# map the list of allowed countries
|
||||
map $geoip_country_code $allowed_country {
|
||||
default no;
|
||||
}
|
||||
|
||||
# map the continents to allow
|
||||
map $geoip_city_continent_code $allowed_continent {
|
||||
default yes;
|
||||
}
|
||||
|
||||
log_format geoipblock '[$time_local] - Geoip blocked $remote_addr';
|
||||
Reference in New Issue
Block a user