Block particular user agent (bots) in nginx

From DevOps Notebook
Revision as of 18:56, 8 October 2020 by MilosZ (talk | contribs)

Add inside nginx server block

    # case insensitive matching
    if ($http_user_agent ~* (netcrawl|npbot|malicious|LWP::Simple|BBBike|wget|jorgee)) {
        return 403;
    }