嘟嘟社区

[疑问] 怎么屏蔽假的百度蜘蛛


  1. 223.111.134.143 – – [19/Jan/2022:10:50:47 +0800] "GET /member/space/person/common/css/css.css HTTP/1.1" 404 146 "https://www.baidu.com/" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.htmlx09"

复制代码

很多,都是国内IP

我尝试nginx这样写 还是无法识别
  1. if ($http_user_agent ~* "spider.htmlx09" ) {
  2.         return 404;
  3.     }

复制代码

$http_user_agent ~* "spider.html..09"

domin 发表于 2022-1-20 08:29
$http_user_agent ~* "spider.html..09"

谢谢大佬我试试