Skip to content

Troubleshooting guide

Cloudflare error 1020: Access denied

A 1020 means one of the site's Cloudflare firewall rules blocked this request on purpose. The origin server never saw it.

3 min read10 sectionsUpdated

On this page

Key points

  • A rule on this site made the decision, not an outage.
  • The Ray ID locates the exact event and rule.
  • Monitoring and API clients are often caught by bot or country rules.
  • Change the rule narrowly rather than disabling it.

What 1020 means

The Cloudflare zone has a custom WAF rule, IP rule or similar control, and this request matched. It is deliberate policy, and it might be correct: the question is whether the visitor was meant to be blocked.

Common causes

  • A country or ASN block catching legitimate users or VPNs.
  • User-agent rules that block curl, scripts or monitoring tools.
  • Rate-based rules tripped by shared corporate IPs.
  • Path rules written too broadly, such as blocking anything containing /admin.
  • Changed browser privacy settings that make a request look like a bot.

Diagnose it

Get the Ray ID from the error page or cf-ray header. In the Cloudflare dashboard, open Security, then Events, and search for that ID. It names the rule, the action, and the fields that matched.

bash
# See the block and the Ray ID
curl -si https://example.com/ | grep -iE '^(HTTP|cf-ray|server)'

# Same request with a browser user agent: does the rule target the UA?
curl -s -o /dev/null -w "%{http_code}\n" -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36' https://example.com/

Fixes

As a visitor: turn off your VPN, try another browser, and send the Ray ID to the site owner.

As a site owner: edit the rule rather than disabling the WAF. Add a narrow exception, use a Managed Challenge instead of Block where people might be wrongly matched, and allow known API clients with a secret header or by token. Review Security Events after every rule change to see who is newly blocked.

Catch it automatically

A firewall change can take down your site for a whole country while your dashboard stays green. Run uptime checks from multiple regions and watch for a region-specific failure. Allow your monitor explicitly, or it will alert every time, and also add a rule that still tests the real path through the WAF.

Frequently asked questions

Why am I blocked but my friend is not?

The rule probably matches something specific to you, such as IP address, country, VPN or browser.

Can a visitor fix 1020?

Only by changing what the rule matches, such as turning off a VPN. Otherwise the site owner must change the rule.

Does the origin log blocked requests?

No. Cloudflare stops them first, so use Security Events.

Check it now, free

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.