将代码加入不让蜘蛛抓取的段内
if ($http_user_agent ~* (baiduspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)){ return 403; }
放入server段内则全站生效,放在location则只有对应的段生效对其他独立的location段无影响.
将代码加入不让蜘蛛抓取的段内
if ($http_user_agent ~* (baiduspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)){ return 403; }
放入server段内则全站生效,放在location则只有对应的段生效对其他独立的location段无影响.
评论 (0)