trying the certifcate check as well

This commit is contained in:
2026-03-19 23:05:37 +00:00
parent f96e93eab1
commit 1ea92b8e6d
14 changed files with 249 additions and 29 deletions
+7 -6
View File
@@ -20,8 +20,8 @@ data:
'\n '$geoip2_data_city_name $geoip2_data_country_name';\n\tlog_format
blocked_fmt '$http_host \\t $remote_addr - [$time_local] '\n\t\t'Blocked Country:
$geoip2_data_country_iso_code '\n '\"$request\" $status';\n\n\tlog_format
deny_style 'deny $remote_addr;';\n\n\tserver {\n\tlisten 80;\n listen 443
default ssl;\n\tssl_certificate /etc/nginx/ssl/live/default.tryton.geeraert.eu/fullchain.pem;
deny_style 'deny $remote_addr; #$geoip2_data_city_name $geoip2_data_country_name';\n\n\tserver
{\n\tlisten 80;\n listen 443 default ssl;\n\tssl_certificate /etc/nginx/ssl/live/default.tryton.geeraert.eu/fullchain.pem;
# managed by$\n ssl_certificate_key /etc/nginx/ssl/live/default.tryton.geeraert.eu/privkey.pem;
# managed $\n location / {\n proxy_pass http://1.1.1.1;\n
\ proxy_redirect off;\n proxy_set_header Host $host;\n
@@ -31,10 +31,11 @@ data:
$http_upgrade $connection_upgrade {\n\t\tdefault upgrade;\n '' close;\n\t}\n\n\tgeoip2
/data/dbip-country-lite-2026-01.mmdb{\n\t\t$geoip2_data_country_iso_code country
iso_code;\n\t $geoip2_data_city_name city names en;\n\t $geoip2_data_country_name
country names en;\n\t}\n \n\tmap $geoip2_data_country_iso_code $allowed_country
{\n\t\tdefault no;\n\t\tFR\tyes; # Allow France\n\t\tGB\tyes; # Allow UK\n #NL
\ yes; # Allow netherland\n\t\t#IN\tyes; # Allow India\n\t}\n\t# Full list
of country codes: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\n\n\tmap
country names en;\n\t}\n \n\tmap $geoip2_data_country_iso_code::$ssl_client_verify
$allowed_country {\n\t\tdefault no;\n\t\tFR\tyes; # Allow France\n\t\tGB\tyes;
# Allow UK\n \"~:SUCCESS$\" yes; # Allow anyone with a valid
certificate (regardless of country)\n #NL yes; # Allow netherland\n\t\t#IN\tyes;
\ # Allow India\n\t}\n\t# Full list of country codes: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\n\n\tmap
$allowed_country $should_log_blocked {\n\t\tno 1;\n\t\tdefault 0;\n\t}\n\n\tinclude
/etc/nginx/deny.d/*.conf;\n\tinclude /etc/nginx/conf.d/*.conf;\n include
/etc/nginx/blacklisted.d/*.conf;\n\n\t# adding this line for the fial2ban settings\t\n