Cloudflare防火墙规则未按预期工作



我有一个防火墙规则来阻止所有流量到我的网站,除了从我的国家。奇怪的是,我可以访问example.com,但即使在我自己的国家,www.example.com也被封锁了。请问我该如何解决这个问题我的F/W规则是这样的

(ip.geoip.country ne "XX") or (ip.geoip.country ne "XY") or (not cf.client.bot) or (http.host ne "example.com") or (http.host ne "www.example.com")

(注意XX和XY是我需要允许流量从美国到美国的两个国家)。问题是我的地理数据显示我在XX国家,但我在访问https://www.example.com时被阻止,但https://example.com工作正常。有人能帮我一下吗?

这个逻辑对于阻塞规则是不正确的,但我无法解释为什么它只适用于www。以下是我对您需要的阻塞规则的最佳猜测:

# if client is a known bot OR client is not one of these two countries OR host is not in one of these two hosts
(cf.client.bot) or (not ip.geoip.country in {"XX" "XY"}) or (not http.host in {"www.example.com" "example.com"})