# nginx-bad-bots.conf — defensive example # source: https://aidebatehub.com/intel/ # generated: 2026-12-05T01:35:06+09:00 # # Placement # - the map blocks go inside the http { } context # - the if lines go inside the target server { } block # - run `nginx -t` before reloading # # Note: User-Agent checks are trivially spoofable. Combine with rate limiting, # fail2ban, and log monitoring rather than relying on this alone. # # observed scanners: zgrab (336 hits), nmap (10 hits) map $http_user_agent $intel_bad_ua { default 0; ~*zgrab 1; ~*nmap 1; ~*nikto 1; ~*sqlmap 1; ~*nuclei 1; ~*gobuster 1; ~*dirbuster 1; ~*ffuf 1; ~*wpscan 1; ~*masscan 1; ~*zmap 1; ~*censys 1; ~*shodan 1; ~*internet-measurement 1; } map $request_method $intel_bad_method { default 0; ~*^(PUT|DELETE|PATCH|TRACE|CONNECT|PROPFIND)$ 1; } # server { # if ($intel_bad_ua) { return 403; } # if ($intel_bad_method) { return 405; } # }