### case sensitive http user agent blocking ###
if ($http_user_agent ~ (Catall Spider|AcoiRobot) ) {
return 403;
}
### case insensitive http user agent blocking ###
if ($http_user_agent ~* (foo|bar) ) {
return 403;
}
map $http_via $is_not_ok {
default "0";
"~*squid" "1";
}
if ($is_not_ok) {
return 405;
}