2023-02-02
禁止用戶(hù)直接訪問(wèn)robots.txt,只允百度等搜索引擎訪問(wèn)(禁止訪問(wèn)該ip,請(qǐng)使用域名訪問(wèn))
location = /robots.txt {
if ($http_user_agent !~* “spider|bot|yahoo|sogou”) {
return 404;
}
}
很多時(shí)候robots.txt 包含了很多信息,有些安全軟件把robots當(dāng)漏洞來(lái)處理,實(shí)際…