#vim/usr/local/nginx/conf/nginx.conf
## Block http user agent - wget ##
if ($http_user_agent ~* (Wget) ) {
return 403;
}
## Block Software download user agents ##
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
return 403;
# /usr/local/nginx/sbin/nginx -s reload
if ($http_user_agent ~ (agent1|agent2|Foo|Wget|Catall Spider|AcoiRobot) ) {
return 403;
}
### 大小写敏感http user agent拒绝###
if ($http_user_agent ~ (Catall Spider|AcoiRobot) ) {
return 403;
}
### 大小写不敏感http user agent拒绝###
if ($http_user_agent ~* (foo|bar) ) {
return 403;
}