LNMP--nginx 禁止指定 user_agent
2018-02-15
LNMP--nginx 禁止指定 user_agent
和 apache 的相关配置相像,具体如下:
location /
{
if ($http_user_agent ~ 'bingbot/2.0|MJ12bot/v1.4.2|Spider/3.0|YoudaoBot|Tomato|Gecko/20100315'){
return 403;
}
}