This commit is contained in:
+24
-1
@@ -1,3 +1,4 @@
|
||||
load_module /usr/lib/nginx/modules/ngx_http_geoip2_module.so;
|
||||
worker_processes 1;
|
||||
events { worker_connections 1024; }
|
||||
|
||||
@@ -26,6 +27,11 @@ http {
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'upstream_status=$upstream_status';
|
||||
log_format localization '$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'$geoip2_data_city_name $geoip2_data_country_name';
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
@@ -48,9 +54,26 @@ http {
|
||||
'' close;
|
||||
}
|
||||
|
||||
geoip2 /data/dbip-country-lite-2026-01.mmdb{
|
||||
$geoip2_data_country_iso_code country iso_code;
|
||||
$geoip2_data_city_name city names en;
|
||||
$geoip2_data_country_name country names en;
|
||||
}
|
||||
|
||||
map $geoip2_data_country_iso_code $allowed_country {
|
||||
default yes;
|
||||
IN no;
|
||||
CN no; # Block China
|
||||
RU no; # Block Russia
|
||||
KP no; # Block North Korea
|
||||
}
|
||||
|
||||
include /etc/nginx/deny.d/*.conf;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
include /etc/nginx/blacklisted.d/*.conf;
|
||||
|
||||
# adding this line for the fial2ban settings
|
||||
#map $cookie_session_id $blck_lst_ses { include /etc/nginx/blacklisted.d/blacklisted-sessions.map; }
|
||||
#add extra file for any extra work
|
||||
include /etc/nginx/extra.conf.d/*.conf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user