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;

      }

}

标题:LNMP--nginx 禁止指定 user_agent
作者:散宜生
地址:https://17kblog.com/articles/2018/02/15/1518687283733.html