opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Blocking 699 bad user-agents and 7,116 spam referrers at the Nginx level
GitHub RepoViews0

Project Description

View on GitHub

Your Nginx Logs Are Full of Junk Traffic—Here's a Way to Shut It Down

You've probably seen them in your access logs: requests from user agents that don't make sense, referrers pointing to sites you'd never want associated with your domain, and bots hammering your server looking for vulnerabilities. You can block these one at a time as you spot them, or you can deal with the whole category of bad traffic before it ever reaches your application. The Nginx Ultimate Bad Bot Blocker from Mitchell Krog takes the second approach—a maintained blocklist and configuration setup that sits at the Nginx level and turns away known bad actors.

What It Does

At its core, this is a set of Nginx configuration files built around generated blocklists. The project maintains lists of bad user agents, bad referrers, and fake Googlebots, and the Nginx config uses those lists to deny requests before they hit your site. The current version (V4.2026.12.6287) ships with 699 bad user agents, 7,116 bad referrers, and 218 fake Googlebots blocked.

Beyond simple blocking, the README describes a broader scope: anti-DDOS measures, Nginx rate limiting, a bad IP blocker, and a WordPress theme detector blocker. It's designed for Nginx specifically—tested on nginx/1.10.x per the README—and there's a separate Apache version of the project if that's your stack. The maintainer asks that you subscribe to GitHub notifications so you're aware of updates or potentially breaking changes, which tells you something about how actively the lists evolve.

Why It's Cool

  • It works at the server level, not the application level. Bad traffic gets rejected by Nginx before your app, your database, or your WordPress install ever sees it. That's less load and fewer chances for something to slip through.

  • The lists are the product. Blocking a bot is easy once you know its user agent string. Keeping a current list of 699 of them—plus thousands of referrers—is the tedious part. This project does that maintenance for you.

  • Fake Googlebots get their own category. Plenty of scrapers masquerade as Googlebot to get past naive allowlists. Having 218 known fakes called out separately is a practical detail that suggests the maintainer has actually watched real traffic.

  • The scope goes past bots. Spam referrers, adware, malware, ransomware, clickjacking, click-redirecting, and SEO company traffic are all named as targets. Whether you care about all of those or just a few, the config covers the ground.

  • There's an easy auto-configuration path. The README points to step-by-step automatic setup instructions as the preferred method, which matters if you'd rather not hand-edit Nginx configs and hope you got the order right.

One honest caveat: blocking at this scale means you're trusting someone else's definition of "bad." The README links to a "Definition of Bad Bots" section for exactly that reason—worth reading before you deploy it on a production site where a false positive could cost you real visitors.

How to Try It

  1. Head to the repository: github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
  2. Confirm your environment—this is built for Nginx (tested on 1.10.x). If you're on Apache, use the Apache Ultimate Bad Bot Blocker instead.
  3. Follow the auto-configuration instructions in the README step by step. The README emphasizes following them in order, so don't skip around.
  4. Subscribe to GitHub notifications for the repo so you hear about list updates and breaking changes.
  5. If you want to see what's being blocked before you commit, the raw lists are public—the README links directly to the bad referrers and bad user agents lists, so you can review them first.

The project is MIT licensed and maintained by Mitchell Krog, with sponsorship and Ko-fi links in the README if you find it useful.

Final Thoughts

This isn't a glamorous tool, and it's not trying to be. It's a well-maintained blocklist with the Nginx plumbing to enforce it, aimed at people running their own servers who are tired of filtering garbage traffic by hand. If you administer an Nginx box—especially one running WordPress—it's worth an afternoon to review the lists and test the config in staging. The main thing to keep in mind is that blocklists are blunt instruments: effective against the obvious stuff, but you'll want to watch your logs after deploying to make sure nothing legitimate got caught in the net.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: nginx-ultimate-bad-bot-blockerLast updated: December 5, 2026 at 02:49 AM