Can't block bot by user-agent

I use bunkerweb (v1.6.14) as reverse-proxy for my sites.

One of my sites is being attacked by bots with “GoogleOther” and “bingbot” in their User-Agent strings.

So, I enabled blacklisting and set BLACKLIST_USER_AGENT to “(?:\b)bingbot|GoogleOther(?:\b)” in the service settings for my site.

…And nothing happens :sweat_smile:

Lines with “bingbot” & “GoogleOther” user agents continue to appear in the site logs every 1-2 seconds.

What is the correct way to block these crawlers?

The issue is resolved. Google bots were whitelisted by default. Consequently, any rules in the blacklists or ModSecurity simply didn’t trigger, because the whitelist takes precedence over the blacklist :slight_smile:

1 Like