Nginx禁止国外搜索引擎蜘蛛爬取方法
if ($http_user_agent ~* (SemrushBot|python|MJ12bot|AhrefsBot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup))
{
return 444;
}
复制到Nginx的配置里面,多个用“|”隔开。
路是自己走出来的,而不是选出来的。
if ($http_user_agent ~* (SemrushBot|python|MJ12bot|AhrefsBot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup))
{
return 444;
}
复制到Nginx的配置里面,多个用“|”隔开。