Disable country blocks

This commit is contained in:
Felix Ableitner 2022-08-03 20:58:45 +02:00
parent 946d6c3ce5
commit 99027a6b96
2 changed files with 17 additions and 17 deletions

View file

@ -1,12 +1,12 @@
limit_req_zone $binary_remote_addr zone=gitea_ratelimit:10m rate=1r/s; limit_req_zone $binary_remote_addr zone=gitea_ratelimit:10m rate=1r/s;
geoip_country /usr/share/GeoIP/GeoIP.dat; #geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country { #map $geoip_country_code $allowed_country {
default yes; # default yes;
CN no; # CN no;
RU no; # RU no;
IN no; # IN no;
} #}
server { server {
listen 80; listen 80;
@ -53,9 +53,9 @@ server {
gzip_proxied any; gzip_proxied any;
gzip_vary on; gzip_vary on;
if ($allowed_country = no) { #if ($allowed_country = no) {
return 444; # return 444;
} #}
location / { location / {
limit_req zone=gitea_ratelimit burst=30 nodelay; limit_req zone=gitea_ratelimit burst=30 nodelay;

View file

@ -1,7 +1,7 @@
map $geoip_country_code $allowed_country { #map $geoip_country_code $allowed_country {
default yes; # default yes;
CN no; # CN no;
} #}
server { server {
listen 80; listen 80;
@ -48,9 +48,9 @@ server {
gzip_proxied any; gzip_proxied any;
gzip_vary on; gzip_vary on;
if ($allowed_country = no) { #if ($allowed_country = no) {
return 444; # return 444;
} #}
location / { location / {
limit_req zone=gitea_ratelimit burst=30 nodelay; limit_req zone=gitea_ratelimit burst=30 nodelay;