Block particular user agent (bots) in nginx
From DevOps Notebook
# case insensitive matching
if ($http_user_agent ~* (netcrawl|npbot|malicious|LWP::Simple|BBBike|wget|jorgee)) {
return 403;
}
# case insensitive matching
if ($http_user_agent ~* (netcrawl|npbot|malicious|LWP::Simple|BBBike|wget|jorgee)) {
return 403;
}