目 录CONTENT

文章目录

LNMP--nginx 禁止指定 user_agent

zhanjie.me
2018-02-15 / 0 评论 / 0 点赞 / 1 阅读 / 0 字

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;

      }

}
0

评论区