9951 explained code solutions for 126 technologies


nginxHow to block user agent


server {
  if ($http_user_agent ~* wget|bot|curl) {
    return 403;
  }
}ctrl + c
server {

virtual server configuration block

$http_user_agent

variable with client user agent

wget|bot|curl

sample regex to filter user agents

return 403;

deny access if user agent matches specified regex