From 4371c3aa277a65765e1382fe11bcfde8a51501e9 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sat, 2 May 2026 11:21:18 +0100 Subject: [PATCH] av: block bots and some IPs Signed-off-by: oppiliappan --- hosts/appview/services/nginx.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hosts/appview/services/nginx.nix b/hosts/appview/services/nginx.nix index d0c01b7..d749560 100644 --- a/hosts/appview/services/nginx.nix +++ b/hosts/appview/services/nginx.nix @@ -17,8 +17,31 @@ ~*CCBot 1; ~*anthropic-ai 1; ~*Claude-Web 1; + ~*ClaudeBot 1; ~*meta-externalagent 1; ~*AliyunSecBot 1; + ~*AhrefsBot 1; + ~*Amazonbot 1; + ~*PetalBot 1; + ~*ThinkBot 1; + ~*SemrushBot 1; + ~*Bytespider 1; + ~*SeznamBot 1; + ~*bingbot 1; + ~*Chrome/112\.0\.0\.0 1; + } + + # Block Vietnamese IP ranges (scraper traffic) + geo $block_vietnam { + default 0; + 14.0.0.0/8 1; + 113.160.0.0/11 1; + 113.172.0.0/14 1; + 113.176.0.0/12 1; + 113.188.0.0/14 1; + 123.16.0.0/12 1; + 123.28.0.0/14 1; + 123.30.0.0/15 1; } ''; @@ -78,6 +101,9 @@ if ($block_bot) { return 403; } + if ($block_vietnam) { + return 403; + } # Redirect www → bare domain if ($host = www.tangled.org) { -- 2.51.2