What is the name of the domain?
What is the issue you’re encountering
want to allow user access by country
What steps have you taken to resolve the issue?
I would like to know what are the options to allow traffic by specific countries/regions only.
I noticed that WAF has this option, is there any other option to achieve this?
Why do you need something else other than a firewall rule to do geo-bloxking?
1 Like
I like to know my options, but thanks for asking.
The questions was if there are any other possibilities besides WAF
It sounds like your question is if it’s possible to do what the WAF does, but without using the WAF.
Why don’t you want to use the easiest solution?
Is there some specific behavior you’re looking for that the WAF doesn’t provide?
You guys keep asking me the same question.
I just want to know, if there is another way Please don’t ask me why I wanna do that again.
You’re not being specific, so we don’t know what behavior you’re after.
To allow traffic from specific countries/regions only, means to Disallow from others (block, which is a 403).
Sure, there are other ways. You can use a Snippet that triggers on the same things a WAF rule would, and it can return a 403.
Cloudflare Snippets provide a powerful and flexible way to customize the behavior of your website or application using short pieces of JavaScript code. With Snippets, you can modify HTTP response headers, implement JWT validation, perform complex...
Same goes for Custom Error Response
Custom Errors (beta), powered by the Ruleset Engine, allow you to define custom content for errors returned by an origin server or by a Cloudflare product (including Workers). Custom Errors will apply to responses whose HTTP status code is greater...
There’s always Access, which can use a Policy based on location:
If you just want to divert unwanted traffic, you can use a Redirect Rule, using the same triggers as a WAF rule:
Bulk Redirects are similar to Redirect Rule. Again, using the same triggers as the WAF rule:
A full-blown worker can do its own checks for countries and regions, and return a 403. Even a Redirect, which a Snippet could also do:
Origin Rules, similar to Redirects, can divert requests to somewhere else if you’re on an Enterprise plan:
1 Like
system
Closed
April 22, 2025, 7:08pm
8
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.