Block all requests from kiwifarms

This commit is contained in:
Felix Ableitner 2019-07-23 16:55:13 +02:00
parent 90bf459c12
commit a698a3d37f
1 changed files with 11 additions and 0 deletions

View File

@ -17,15 +17,26 @@ http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=peertube_cache:10m max_size={{ cache_size_gb }}g use_temp_path=off;
geo $bad_user {
default 0;
103.114.191.0/24 1;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{domain}};
# Block all requests from Gab instances
# https://soteria.mastodon.host/notice/9ke8a2nybZ0yPiHBJY
if ($http_user_agent ~* "GabSocial") {
return 404;
}
# Block all requests from Kiwifarms IP range
# https://glitch.social/@kyzh/102435853605463552
if ($bad_user) {
return 404;
}
ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem;