国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - Nginx - Nginx限制搜索引擎爬蟲頻率、禁止屏蔽網絡爬蟲配置示例

Nginx限制搜索引擎爬蟲頻率、禁止屏蔽網絡爬蟲配置示例

2019-10-22 15:31Nginx教程網 Nginx

這篇文章主要介紹了Nginx限制搜索引擎爬蟲頻率、禁止屏蔽網絡爬蟲配置示例,限制爬蟲頻率用于一些無良爬蟲,禁止爬蟲用于一些不需要收錄的網站,需要的朋友可以參考下

代碼如下:


#全局配置
limit_req_zone $anti_spider zone=anti_spider:10m rate=15r/m;

 

#某個server中
 limit_req zone=anti_spider burst=30 nodelay;
 if ($http_user_agent ~* "xxspider|xxbot") {
 set $anti_spider $http_user_agent;
}

 

超過設置的限定頻率,就會給spider一個503。
上述配置詳細解釋請自行google下,具體的spider/bot名稱請自定義。

附:nginx中禁止屏蔽網絡爬蟲

復制代碼代碼如下:


server {  
        listen       80;  
        server_name  www.xxx.com;  
  
        #charset koi8-r;  
  
        #access_log  logs/host.access.log  main;  
  
        #location / {  
        #    root   html;  
        #    index  index.html index.htm;  
        #}  
    if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") {  
                return 403;  
        }  
  
    location ~ ^/(.*)$ {  
                proxy_pass http://localhost:8080;  
        proxy_redirect          off;  
        proxy_set_header        Host $host;  
        proxy_set_header        X-Real-IP $remote_addr;  
        proxy_set_header       X-Forwarded-For   $proxy_add_x_forwarded_for;  
        client_max_body_size    10m;  
        client_body_buffer_size 128k;  
        proxy_connect_timeout   90;  
        proxy_send_timeout      90;  
        proxy_read_timeout      90;  
        proxy_buffer_size       4k;  
        proxy_buffers           4 32k;  
        proxy_busy_buffers_size 64k;  
        proxy_temp_file_write_size 64k;  
    }  
      
        #error_page  404              /404.html;  
  
        # redirect server error pages to the static page /50x.html  
        #  
        error_page   500 502 503 504  /50x.html;  
        location = /50x.html {  
            root   html;  
        }  
  
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80  
        #  
        #location ~ \.php$ {  
        #    proxy_pass   http://127.0.0.1;  
        #}  
  
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000  
        #  
        #location ~ \.php$ {  
        #    root           html;  
        #    fastcgi_pass   127.0.0.1:9000;  
        #    fastcgi_index  index.php;  
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
        #    include        fastcgi_params;  
        #}  
  
        # deny access to .htaccess files, if Apache's document root  
        # concurs with nginx's one  
        #  
        #location ~ /\.ht {  
        #    deny  all;  
        #}  
    }  

 


可以用 curl 測試一下

復制代碼代碼如下:

curl -I -A "qihoobot" www.xxx.com

 

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 久久久久久毛片免费播放 | 国产 日韩 欧美 中文 在线播放 | 国产精品精品久久久 | 羞羞视频在线播放 | 午夜视频免费在线观看 | 中文字幕不卡在线观看 | 四虎免费紧急入口观看 | 九色网址 | 色综合天天天天做夜夜夜夜做 | 亚洲三级在线 | 久久av网| 九九综合 | 久久99精品久久久久久久青青日本 | 九九久久精品 | 黄色美女网站免费 | 91嫩草国产露脸精品国产 | 黄色裸体网站 | 亚洲高清在线视频 | 冷水浴在线观看 | 一区二区不卡视频 | 亚洲视频免费观看 | 在线观看的av | 亚洲在线视频一区二区 | 欧美午夜视频 | 国产精品福利午夜在线观看 | 亚洲免费人成在线视频观看 | 国产免费一区二区三区 | 国内精品一区二区三区 | 日本成人高清视频 | 男人天堂视频网 | 欧美视频二区 | 99精品久久 | 久久久久久国产免费 | 亚洲精品系列 | 在线中文字幕视频 | 久久午夜电影 | 国产电影一区二区三区图片 | 日本一级淫片免费看 | 亚洲专区 中文字幕 | 欧美一级全黄 | 青青青国产精品一区二区 |