Problem with “Block Non-US Traffic” WAF Why isn't traffic blocked outside the U.S.?

What is the name of the domain?

https://www.patientjourneys.org/

What is the issue you’re encountering

I need non-US traffic to be blocked.

What steps have you taken to resolve the issue?

Hello Cloudflare community,

I am having problems with a firewall rule that I have configured to block all traffic not coming from the U.S. Below I am providing you with the details of my configuration and the problem I am facing:
Rule Configuration:

Rule Name: Block Non-US Traffic

Expression: (ip.geoip.country ne “US”)

Action: Block

Problem Description:

I have configured this rule to block all traffic that does not come from the U.S. However, when I use a VPN and connect from another country (e.g. France), I can still access my site. This makes me think that the rule is not being applied correctly.
Steps I followed to solve the problem:

I verified the IP address of my VPN using tools like ipinfo.io and confirmed that the IP is not registered in the US.

I placed the Block Non-US Traffic rule at the top of the list of rules to make sure it is evaluated first.

I purged the Cloudflare cache to rule out cache related issues.

I verified that Cloudflare's security mode is set to an appropriate level (e.g., “Medium” or “High”).

What is the current SSL/TLS setting?

Off

What are the steps to reproduce the issue?

Connect to a VPN, other than a US country.

I did all the steps indicated here! and it still doesn’t work!:

Must be something wrong as it doesnt block the UK

Is it the first WAF rule?

Can you post up the actual rule?

Your DNS records for the apex domain and www aren’t proxied…
https://cf.sjr.dev/tools/check?d1a820edceac4f9ca2b1c81695d54c34#dns

Requests are going direct to your origin and not through Cloudflare so your WAF and other Cloudflare settings won’t have any effect.

4 Likes

Hello,

Thank you very much for your help! yes you were right, I have managed to make another configuration from the server side, and I have achieved the goal.

Thanks for the help, you are all very kind, you can close this issue!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.