This commit is contained in:
+11
-7
@@ -31,7 +31,9 @@ http {
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'$geoip2_data_city_name $geoip2_data_country_name';
|
||||
|
||||
log_format blocked_fmt '$http_host \t $remote_addr - [$time_local] '
|
||||
'Blocked Country: $geoip2_data_country_iso_code '
|
||||
'"$request" $status';
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
@@ -62,16 +64,18 @@ http {
|
||||
|
||||
map $geoip2_data_country_iso_code $allowed_country {
|
||||
default no;
|
||||
#NL yes; # Allow netherland
|
||||
FR yes; # Allow France
|
||||
GB yes; # Allow UK
|
||||
NL no; # Block netherland
|
||||
IN no; # Block India
|
||||
CN no; # Block China
|
||||
RU no; # Block Russia
|
||||
KP no; # Block North Korea
|
||||
#NL yes; # Allow netherland
|
||||
#IN yes; # Allow India
|
||||
}
|
||||
# Full list of country codes: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
|
||||
map $allowed_country $should_log_blocked {
|
||||
no 1;
|
||||
default 0;
|
||||
}
|
||||
|
||||
include /etc/nginx/deny.d/*.conf;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/blacklisted.d/*.conf;
|
||||
|
||||
Reference in New Issue
Block a user