站三界导航
首页 建站经验Cloudflare一条全面的防火墙规则,粘贴即用

Cloudflare一条全面的防火墙规则,粘贴即用

  • 建站经验
  • 来源:站三界导航
  • 60阅读
  • 2023-05-26

规则名称:禁止中国大陆、台湾、香港、澳门以外的IP地址访问和禁止垃圾蜘蛛

规则动作:拒绝访问

规则条件:

IP地址不在中国大陆、台湾、香港、澳门范围内

User-Agent不包含常见的垃圾蜘蛛标识符

规则优先级:高

规则代码:

(http.request.uri.path contains "your-website-domain.com") and ip.geoip.country not in {"CN" "TW" "HK" "MO"} and not (http.user_agent contains "Baiduspider" or http.user_agent contains "Googlebot" or http.user_agent contains "bingbot" or http.user_agent contains "YandexBot" or http.user_agent contains "Sogou" or http.user_agent contains "Exabot" or http.user_agent contains "facebot" or http.user_agent contains "ia_archiver" or http.user_agent contains "MJ12bot" or http.user_agent contains "AhrefsBot" or http.user_agent contains "SemrushBot" or http.user_agent contains "DotBot" or http.user_agent contains "rogerbot" or http.user_agent contains "BLEXBot" or http.user_agent contains "CCBot" or http.user_agent contains "coccocbot" or http.user_agent contains "aihitbot" or http.user_agent contains "spbot" or http.user_agent contains "linkdexbot" or http.user_agent contains "archive.org_bot" or http.user_agent contains "Pagespeed" or http.user_agent contains "Pingdom" or http.user_agent contains "Siteimprove" or http.user_agent contains "ZoominfoBot" or http.user_agent contains "Lighthouse" or http.user_agent contains "W3C_Validator" or http.user_agent contains "NetcraftSurveyAgent" or http.user_agent contains "PhantomJS" or http.user_agent contains "Screaming Frog SEO Spider" or http.user_agent contains "UptimeRobot" or http.user_agent contains "Datadog" or http.user_agent contains "Dynatrace" or http.user_agent contains "NewRelicPinger" or http.user_agent contains "StatusCake" or http.user_agent contains "Updown.io" or http.user_agent contains "Zabbix" or http.user_agent contains "AppDynamics" or http.user_agent contains "Catchpoint" or http.user_agent contains "GTMetrix" or http.user_agent contains "LoadImpactPageAnalyzer" or http.user_agent contains "PingdomPageSpeed" or http.user_agent contains "Yellow Lab Tools" or http.user_agent contains "Google PageSpeed Insights" or http.user_agent contains "Lighthouse Audit" or http.user_agent contains "Mozilla/5.0 zgrab/0.x" or http.user_agent contains "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)" or http.user_agent contains "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)" or http.user_agent contains "Mozilla/5.0 (compatible; Seekport Crawler; http://seekport.com/)" or http.user_agent contains "Mozilla/5.0 (compatible; Cliqzbot/3.0; +http://cliqz.com/company/cliqzbot)" or http.user_agent contains "Mozilla/5.0 (compatible; Qwantify/2.4w; +https://www.qwant.com/)"} 
请将上述规则代码复制到Cloudflare防火墙规则中,并将其中的"your-website-domain.com"替换为您的网站域名。此规则将禁止中国大陆、台湾、香港、澳门以外的IP地址访问您的网站,并禁止常见的垃圾蜘蛛访问。如果您需要添加其他规则,请告诉我,我会为您提供帮助。

本文结束
本文来自投稿,不代表站三界导航立场,如若转载,请注明出处:https://www.zhansanjie.com/article/details/43795.html

版权声明:

1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

2、本站仅提供信息发布平台,不承担相关法律责任。

3、若侵犯您的版权或隐私,请联系本站管理员删除。

4、本文由会员转载自互联网,如果您是文章原创作者,请联系本站注明您的版权信息。

分享
站三界导航
本站声明:本站严格遵守国家相关法律规定,非正规网站一概不予收录。本站所有资料取之于互联网,任何公司或个人参考使用本资料请自辨真伪、后果自负,站三界导航不承担任何责任。在此特别感谢您对站三界导航的支持与厚爱。