一元网络论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 193|回复: 0

利用 Cloudflare WAF 规则阻断来自中国大陆的浏览器访问。

[复制链接]

2万

主题

2万

帖子

8万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
89155
发表于 2024-8-7 00:41:37 | 显示全部楼层 |阅读模式
## Cloudflare WAF免费计划可添加5条自定义规则,以下提供屏蔽国内浏览器的规则:
```
(http.user_agent contains "115Browser") or (http.user_agent contains "2345chrome") or (http.user_agent contains "2345Explorer") or (http.user_agent contains "360EE") or (http.user_agent contains "360SE") or (http.user_agent contains "AliApp") or (http.user_agent contains "Baidu") or (http.user_agent contains "BaiduHD") or (http.user_agent contains "baidubrowser") or (http.user_agent contains "baiduboxapp") or (http.user_agent contains "baidu") or (http.user_agent contains "BIDUBrowser") or (http.user_agent contains "com.douban.frodo") or (http.user_agent contains "DingTalk") or (http.user_agent contains "HarmonyOS") or (http.user_agent contains "HUAWEI") or (http.user_agent contains "HuaweiBrowser") or (http.user_agent contains "huawei") or (http.user_agent contains "IqiyiApp") or (http.user_agent contains "LBBROWSER") or (http.user_agent contains "LieBaoFast") or (http.user_agent contains "Mb2345Browser") or (http.user_agent contains "MetaSr") or (http.user_agent contains "MicroMessenger") or (http.user_agent contains "MiuiBrowser") or (http.user_agent contains "MZBrowser") or (http.user_agent contains "OppoBrowser") or (http.user_agent contains "QHBrowser") or (http.user_agent contains "QihooBrowser") or (http.user_agent contains "QQ") or (http.user_agent contains "QQBrowser") or (http.user_agent contains "Quark") or (http.user_agent contains "SNEBUY-APP") or (http.user_agent contains "Sogou") or (http.user_agent contains "SP-engine") or (http.user_agent contains "TheWorld") or (http.user_agent contains "UC") or (http.user_agent contains "UCBrowser") or (http.user_agent contains "UCWEB") or (http.user_agent contains "UBrowser") or (http.user_agent contains "VivoBrowser") or (http.user_agent contains "WeChat") or (http.user_agent contains "Weibo") or (http.user_agent contains "Weixin") or (http.user_agent contains "wxwork")
```
规则已按首字母顺序排序,涵盖了大部分常见的国内浏览器。如有遗漏欢迎补充。
**使用方法:**
1. 进入Cloudflare Dashboard,选择托管的域名。
2. 点击左侧Security → WAF → Custom rules → Create rule。
3. 在Expression preview右侧的Edit expression中粘贴以上规则。
**注意:** Cloudflare WAF规则区分大小写。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|一元网络论坛

GMT+8, 2024-11-15 13:02 , Processed in 0.075322 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表