NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
soho176
V2EX  ›  NGINX

Nginx.conf屏蔽搜索引擎蜘蛛,一些蜘蛛根本不回来流量但是抓取的太多了 浪费网站流量,想只让百度和谷歌的蜘蛛访问,别的蜘蛛来的话 直接跳转到大网站比如百度。

  •  
  •   soho176 · May 31, 2013 · 7981 views
    This topic created in 4752 days ago, the information mentioned may be changed or developed.
    找到 下面的代码 但是这个代码 返回的是403 我想让他 直接访问跳到别的网站,跳到百度去。
    if ($http_user_agent ~* (soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)){
    return 403;
    }
    4 replies    1970-01-01 08:00:00 +08:00
    luztak
        1
    luztak  
       May 31, 2013
    记得PHP的做法是Header("Location:http://www.baidu.com");
    你可以试试写个no_other_spider的filter,碰到别家机器人就把Header 301到百度
    binux
        2
    binux  
       May 31, 2013   ❤️ 1
    rewrite .* http://www.baidu.com/ break;
    infong
        3
    infong  
       Jun 1, 2013 via Android
    revlis7
        4
    revlis7  
       Jun 1, 2013
    应该再加上一个360spider
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3685 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 04:27 · PVG 12:27 · LAX 21:27 · JFK 00:27
    ♥ Do have faith in what you're doing.