WAF block country

Type

Product improvement

Description

WAF block/unblock error message

Benefit

Currently if you block an IP or country using WAF the message that shows is “Sorry, you have been blocked” Is there a way to shows something clearer eg " Sorry your have been blocked because the request is originating in Britain where we do not operate" or something like this?

A few options:

  • use a Redirect Rule matching on (not) country to redirect to a specific page on your site
  • use a Redirect Rule matching on (not) country to a Pages site (e.g. not-allowed.example.com) if you want to keep the requests off your origin
  • use a Worker or, better if on a paid plan, Snippet to redirect to or serve up a custom page or HTML based on the (not) country - modification of this… Maintenance page · Cloudflare Rules docs
  • use a custom error page, but they are not quite as specific on the reason that says the reason by using the ::GEO:: token…
    Custom Errors · Cloudflare Rules docs
2 Likes

Thanks very much for that. It is what I would have done using AWS (new to Cloudflare) however I think I must be missing something as cannot see an option for Redirect which would seem the right thing to do. The list is extensive, available are URL full , URL , URI path , URL Query string, AS Num, Cookie, Country, Continent, Hostname, IP source Address, Referer, Request Method, SSL/HTTPS , HTTP version, User agent, x-forwaded-for , Client Certificate, Disposable email check, Known Bots, Verified Not category, MIME Type, Header, Cookie Value of , Password, Leaked , Fallthrough detected, but not Redirect? . Am I missing something here? And closing this question does not solve it.

Closing this topic, as the feature requested already exists, and the original question was answered.