Cloudflare: Error 1009: Country or region banned
Last verified
Error 1009: Access denied: Country or region bannedWhat it means
Error 1009 means the site owner has blocked the country or region associated with your IP address. Cloudflare determines location from the connecting IP, so the block applies to where the request appears to come from, not where you are.
For automation, this commonly appears when a job runs in a cloud region in another country than the person who wrote it. A script developed on a laptop in one country and deployed to a server in another can start receiving 1009 without any code change.
For the site owner, the block comes from an IP Access rule or a custom rule that matches on country. Cloudflare's guidance is to make sure the reported IP address is allowed under IP Access rules if the block was unintended.
What it looks like
$ curl -s https://www.cloudflare.com/cdn-cgi/trace | grep loc
loc=DEWhy it happens
- The owner blocks the country of your IP with an IP Access rule or WAF custom rule.
- Your automation runs in a cloud region located in a blocked country.
- IP geolocation databases place your IP in a different country than expected.
- A corporate network or VPN egresses in another country.
How to fix it
- Check which country your requests come from, for example by requesting /cdn-cgi/trace on any Cloudflare site and reading the loc field.
- If your job runs in an unintended region, deploy it to a region in your own country.
- Visitors: contact the site owner and ask them to allow your IP address.
- Respect the restriction; do not use infrastructure in another country specifically to evade it.
- Site owners: review country rules in IP Access rules and custom rules, and allowlist specific partner IPs.
How to stop it recurring
Choose infrastructure regions deliberately and record them. Site owners: prefer challenges over blanket country blocks where possible, and publish a contact route for legitimate users caught by the rule.
Official documentation: developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1009. See all Cloudflare error messages.
Related errors
Definitions
- CAPTCHACAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a challenge-response m
- Cloudflare Bot ManagementCloudflare Bot Management is the set of Cloudflare features (Bot Fight Mode, Super Bot Fight Mode and the Ente
- Cloudflare TurnstileCloudflare Turnstile is Cloudflare's free CAPTCHA replacement: a widget that runs invisible browser checks, is
- User AgentA user agent is a string that browsers send with every HTTP request identifying the browser type, version, and
- Rate LimitingRate limiting is a technique that controls the number of requests a client can make to a server within a given
Quick answers
What does "Error 1009: Country or region banned" mean in Cloudflare?
Error 1009 means the site owner has blocked the country or region associated with your IP address. Cloudflare determines location from the connecting IP, so the block applies to where the request appears to come from, not where you are. For automation, this commonly appears when a job runs in a cloud region in another country than the person who wrote it.
How do I fix "Error 1009: Country or region banned"?
1. Check which country your requests come from, for example by requesting /cdn-cgi/trace on any Cloudflare site and reading the loc field. 2. If your job runs in an unintended region, deploy it to a region in your own country. 3. Visitors: contact the site owner and ask them to allow your IP address. 4. Respect the restriction; do not use infrastructure in another country specifically to evade it. 5. Site owners: review country rules in IP Access rules and custom rules, and allowlist specific partner IPs.
Retries and timeouts without writing the loop
Autonoly's HTTP Request node and browser steps have per-node retries, timeouts and continue-on-fail, so a transient 429 or 503 can back off instead of failing the run. It has no proxies or IP rotation: if a site blocks automated traffic, that block applies to Autonoly too.
Also see Error handling in workflows.