success with geoip2
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 50s

This commit is contained in:
2026-03-13 00:33:43 +00:00
parent 2ea483265b
commit 3570e436f8
4 changed files with 70 additions and 48 deletions
+11 -7
View File
@@ -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;