Nginx禁止国外搜索引擎蜘蛛爬取方法

if ($http_user_agent ~* (SemrushBot|python|MJ12bot|AhrefsBot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup)) 
 { 
 return 444;
 }

 复制到Nginx的配置里面,多个用“|”隔开。

 
posted @ 2023-03-20 09:57  安语未  阅读(76)  评论(0编辑  收藏  举报