mirror of
https://github.com/linuxserver/docker-swag.git
synced 2025-02-02 09:35:03 -05:00
Adjust geoip2 instructions
This commit is contained in:
parent
891aa6bc71
commit
b58ee45818
@ -2,32 +2,52 @@
|
|||||||
# To enable, uncommment the Geoip2 config line in nginx.conf
|
# To enable, uncommment the Geoip2 config line in nginx.conf
|
||||||
# Add the -e MAXMINDDB_LICENSE_KEY=<licensekey> to automatically download the Geolite2 database.
|
# Add the -e MAXMINDDB_LICENSE_KEY=<licensekey> to automatically download the Geolite2 database.
|
||||||
# A Maxmind license key can be acquired here: https://www.maxmind.com/en/geolite2/signup
|
# A Maxmind license key can be acquired here: https://www.maxmind.com/en/geolite2/signup
|
||||||
# The below config is for geoblocking any country/city you add. The default config is blocking all countries/cities except the ones you set to "yes".
|
|
||||||
# If you want to do the opposite, set default to "yes", and the countries/cities to "no".
|
|
||||||
# As the default config blocks all IP's except the ones in the GeoLite2-City.mmdb database set to yes, you will need to allow your lan ip for local access.
|
|
||||||
|
|
||||||
|
geoip2 /config/geoip2db//GeoLite2-City.mmdb {
|
||||||
geoip2 /config/geoip2db/GeoLite2-City.mmdb {
|
auto_reload 1w;
|
||||||
auto_reload 5m;
|
|
||||||
$geoip2_data_country_code country iso_code;
|
|
||||||
$geoip2_data_city_name city names en;
|
$geoip2_data_city_name city names en;
|
||||||
|
$geoip2_data_postal_code postal code;
|
||||||
|
$geoip2_data_latitude location latitude;
|
||||||
|
$geoip2_data_longitude location longitude;
|
||||||
|
$geoip2_data_state_name subdivisions 0 names en;
|
||||||
|
$geoip2_data_state_code subdivisions 0 iso_code;
|
||||||
|
$geoip2_data_continent_code continent code;
|
||||||
|
$geoip2_data_country_iso_code country iso_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
# GEOIP2 COUNTRY CONFIG
|
# GEOIP2 COUNTRY CONFIG
|
||||||
map $geoip2_data_country_code $allowed_country {
|
map $geoip2_data_country_iso_code $allowed_country {
|
||||||
default no;
|
# default must be yes or no
|
||||||
<COUNTRY-CODE> yes; # e.g GB yes; for United Kingdom
|
default yes;
|
||||||
IP/CIDR yes; # e.g. 192.168.1.0/24 yes; for local access.
|
|
||||||
|
# Below you will setup conditions with yes or no
|
||||||
|
# ex: <condition> <yes/no>;
|
||||||
|
# If your default is set to yes you can setup conditions that would set it to no (and vice versa)
|
||||||
|
# Conditions are either network address (CIDR notation) or country code
|
||||||
|
|
||||||
|
# allow United Kingdom.
|
||||||
|
#GB yes;
|
||||||
|
|
||||||
|
# allow local access.
|
||||||
|
#192.168.1.0/24 yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
#(Optional)
|
|
||||||
# GEOIP2 CITY CONFIG
|
# GEOIP2 CITY CONFIG
|
||||||
# map $geoip2_data_city_name $allowed_city {
|
map $geoip2_data_city_name $allowed_city {
|
||||||
# default no;
|
# default must be yes or no
|
||||||
# <CITY-NAME> yes; # e.g Inverness yes;
|
default yes;
|
||||||
# IP/CIDR yes; # e.g. 192.168.1.0/24 yes; for local access.
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
# Below you will setup conditions with yes or no
|
||||||
|
# ex: <condition> <yes/no>;
|
||||||
|
# If your default is set to yes you can setup conditions that would set it to no (and vice versa)
|
||||||
|
# Conditions are either network address (CIDR notation) or city name
|
||||||
|
|
||||||
|
# allow Inverness.
|
||||||
|
#Inverness yes;
|
||||||
|
|
||||||
|
# allow local access.
|
||||||
|
#192.168.1.0/24 yes;
|
||||||
|
}
|
||||||
|
|
||||||
# Server config example:
|
# Server config example:
|
||||||
# Add the following if statement inside any server context where you want to geo block countries.
|
# Add the following if statement inside any server context where you want to geo block countries.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user