Nginx Proxy Guard

Features

Bot filter

The bot filter reads a request's User-Agent header and blocks known bad bots, AI training crawlers and automation tools. The check is a regular expression in nginx, so blocked requests never reach the backend. They get a 403 and are listed under Logs → Bot Filter.

The User-Agent is a value any client can change. The bot filter weeds out bots that announce themselves and common tools; it is not access control. To let in only certain addresses, use an access list.

Where it is

LocationContents
Proxy host edit dialog → Security tab → Bot FilterPer-host settings: choose Inherit, Override or Disable.
WAF / Blocking → Global Bot FilterDefaults for every host set to inherit
Settings → Bot FilterThe four bot lists shared by all hosts
Global bot filter default
Global bot filter default

A new host's bot filter starts as Inherit, and the global bot filter is off by default. Saving the global default regenerates every inheriting host.

Settings

These fields appear when a host is set to Override or when the global default is on.

FieldMeaningDefault
Block Bad BotsBlocks requests that match the bad bot list.on
Block AI BotsBlocks requests that match the AI bot list.off
Allow Search EnginesRequests that match the search engine list skip the bot filter.on
Block Suspicious ClientsBlocks requests that match the suspicious client list (curl, python-requests, headless browsers and the like).off
Custom Block ListExtra User-Agents to block on this host, one per line.empty
Custom Allow ListUser-Agents that skip the bot filter's blocks, on the whole site or only under the paths you give.empty

Bot lists

Settings → Bot Filter holds the lists that every host shares.

ListUsed by
Bad Bot ListBlock Bad Bots
AI Bot ListBlock AI Bots
Search Engine ListAllow Search Engines, and Allow Search Bots in geo and cloud blocking
Challenge Suspicious RequestsBlock Suspicious Clients. The screen shows it under this name, but matching requests are blocked with a 403, not challenged.

How lists are read

The lists and the custom fields follow the same rules.

  • One pattern per line, matched as a case-insensitive substring: bot also matches Googlebot.
  • * matches any characters. A space or tab matches one whitespace character. Every other character stands for itself.
  • Blank lines and lines starting with # are skipped.
  • Only the first 100 lines of a list are used, and a line is cut at 500 bytes.
# example
SemrushBot
MJ12bot
SomeScraperBot/*

Allowing an agent only under some paths

Add @ and paths to a line of the Custom Allow List to skip the blocks only under those paths.

GoodBot
okhttp @ /api
python-requests @ /webhook /hooks
  • okhttp @ /api covers /api and everything below it, not /api-admin.
  • Put a space on each side of @. Paths start with /, are case-sensitive, and cannot contain %, ?, #, // or . and .. segments (at most 255 characters).
  • Up to 20 lines can be limited to paths, with up to 10 paths per line.
  • A preview under the field shows "whole site" or "only under …" for each line, and the reason for any line that is not applied.
  • A host that overrides the bot filter uses only its own allow list; it is not merged with the global default's.

Interaction with other features

These requests skip the bot filter:

  • addresses in Priority Allow IPs on the Security tab
  • the global trusted IPs (Settings → WAF Auto-Ban)
  • User-Agents in the search engine list, when Allow Search Engines is on
  • User-Agents in the Custom Allow List
  • the /.well-known/acme-challenge/ path

On hosts with the bot filter on, the User-Agent blocking of blocklist subscriptions follows the same exemptions (Priority Allow IPs, global trusted IPs, allowed search engines, the allow list).

Limits

  • Only the User-Agent is checked. Bots that pose as browsers get through; limit request volume with the rate limit in Security headers and rate limits and attack patterns with the WAF.
  • Patterns past the 100th line of a list are not used.
  • Redirect hosts and TCP/UDP stream hosts cannot use the bot filter.