zoukankan      html  css  js  c++  java
  • Nginx 常用屏蔽规则

    //在 /www/server/nginx/conf 新建文件 bot.conf
    #禁止垃圾搜索引擎蜘蛛抓取
    
    if ($http_user_agent ~* "CheckMarkNetwork|Synapse|Nimbostratus-Bot|Dark|scraper|LMAO|Hakai|Gemini|Wappalyzer|masscan|crawler4j|Mappy|Center|eright|aiohttp|MauiBot|Crawler|researchscan|Dispatch|AlphaBot|Census|ips-agent|NetcraftSurveyAgent|ToutiaoSpider|EasyHttp|Iframely|sysscan|fasthttp|muhstik|DeuSu|mstshash|HTTP_Request|ExtLinksBot|package|SafeDNSBot|CPython|SiteExplorer|SSH|MegaIndex|BUbiNG|CCBot|NetTrack|Digincore|aiHitBot|SurdotlyBot|null|SemrushBot|Test|Copied|ltx71|Nmap|DotBot|AdsBot|InetURL|Pcore-HTTP|PocketParser|Wotbox|newspaper|DnyzBot|redback|PiplBot|SMTBot|WinHTTP|Auto Spider 1.0|GrabNet|TurnitinBot|Go-Ahead-Got-It|Download Demon|Go!Zilla|GetWeb!|GetRight|libwww-perl|Cliqzbot|MailChimp|SMTBot|Dataprovider|XoviBot|linkdexbot|SeznamBot|Qwantify|spbot|evc-batch|zgrab|Go-http-client|FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|YisouSpider|HttpClient|MJ12bot|EasouSpider|LinkpadBot|Ezooms") {
     return 444;
     break;
    }
    
    #禁止扫描工具客户端
    
    if ($http_user_agent ~* (Curl|SemrushBot|python|MJ12bot|AhrefsBot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup)) {
         return 444;
         break;
    }

    nginx的444状态是直接由服务器中断连接,不会向客户端再返回任何消息,比返回403更加暴力。

    网站中找到对应的网站, 设置->配置文件 加入下面这行代码 保存

    include bot.conf; 
  • 相关阅读:
    List集合之Vector分析
    List集合之ArrayList分析
    Linux下的tar压缩解压缩命令详解
    第五次会议(4.7)
    第四次会议(3.31)
    第三次会议(3.17)
    第二次会议(3.9)
    第一次会议(3.1)
    团队的Kick off
    Parse error: syntax error, unexpected T_ENDFOREACH in..报错处理
  • 原文地址:https://www.cnblogs.com/LF-place/p/13920803.html
Copyright © 2011-2022 走看看