Block Country - Not with Firewall Rules

Is there a way to block traffic from a specific country without doing it using Firewall Rules? I’ve tried to implement this block filter in the IP Access Rules section, but apparently it’s only for Enterprise customers.

I manage my Firewall Rules via API and I would like to manage the Country Blocking manually.

You could use a Redirect Rule instead, and send those requests to https://localhost

Yes, this could be an option. However, I see that Redirect Rules only have 3XX status codes. Ideally I should be able to throw a 403 error or similar to the blocked countries.

I’ve not tried this, but there is a Custom Error Response feature available through the API:

https://api.cloudflare.com/#custom-error-responses-get-custom-error-responses

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