This project supplies nginx includes, IP and user-agent lists, and shell scripts to block unwanted bots, spam referrers, scanners, and related traffic on sites you host with nginx.
Overview
The Nginx Ultimate Bad Bot Blocker is a set of nginx configuration fragments and maintenance scripts meant to stop malicious or unwanted HTTP traffic before it reaches your applications. It targets bad user-agents, fake search crawlers, spam referrers, vulnerability scanners, malware-related patterns, and related abuse, alongside rate limiting and related hardening.
Installation is driven by setup, install, and update shell scripts that download list files, wire includes into nginx.conf and virtual host files, and optionally whitelist your own IP. The usual flow assumes common Linux layouts with sites-available vhosts ending in .vhost, with flags to adapt paths and extensions.
Daily cron jobs can refresh blacklists and reload nginx so lists stay current. Local customization files under the bots.d directory are preserved across updates. Curl-based tests can confirm legitimate bots receive success responses while blocked agents get connection resets or empty replies.
It is tested against mainstream nginx versions on Linux and can be installed via distribution packages on FreeBSD. Users behind Cloudflare are advised to disable CDN caching while validating blocker behavior.
Key features
- Large maintained bad referrer and bot lists
- Automated install and setup shell scripts
- Daily update script with optional email reports
- Customizable whitelist and blacklist includes
- Fake Googlebot and scanner blocking
- nginx rate limiting integration
- WordPress theme detector blocking
- Fail2Ban jail support for repeat offenders
Use cases
- Reducing scraper and spam referrer noise
- Blocking vulnerability scanners at the edge
- Protecting WordPress sites on nginx
- Automated daily security list updates
- Validating bot allow and deny behavior