adding specifiy geoip option
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 16m53s

This commit is contained in:
2026-04-15 09:29:59 +01:00
parent 9335e0ac24
commit b1def329e9
7 changed files with 95 additions and 23 deletions
+5 -3
View File
@@ -9,11 +9,13 @@ upstream ${name_site}_backend {
server {
server_name ${name_site}.tryton.geeraert.eu www.${name_site}.tryton.geeraert.eu;
if ($allowed_country = no) {
%{ if geoip_blocking}
if ($allowed_country_${upper(join("_", sort(geoip_allow)))} = no) {
return 444; # Forbidden
# Or use 'return 444;' to close the connection without a response
# The 444 Status: If you want to save bandwidth and "ghost" attackers, use return 444;. It drops the connection immediately without even sending a "Forbidden" header.
}
}
%{ endif }
location / {
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend;
@@ -55,7 +57,7 @@ server {
access_log /var/log/nginx/access.log my_custom_format;
access_log /var/log/nginx/ip_audit.log ip_audit;
access_log /var/log/nginx/backend_debug.log backend_debug;
access_log /var/log/nginx/blocked_countries.log blocked_fmt if=$should_log_blocked;
access_log /var/log/nginx/blocked_countries.log blocked_fmt if=$should_log_blocked_${upper(join("_", sort(geoip_allow)))};
${extra-value}
%{~ if http2_bool~}
http2 on;