
A Cloudflare Error 1020 means a Cloudflare firewall rule has blocked the request. Unlike server-level errors (520, 521, 522), a 1020 is Cloudflare itself refusing to let the request through to your origin server. It's a security measure — Cloudflare evaluated the request against your firewall rules and decided it looked suspicious or matched a block rule.
This error affects both legitimate visitors who get caught by overly aggressive rules and site owners who need to fine-tune their security settings. Here's how to diagnose and fix it from both sides.
Cloudflare sits between your visitors and your origin server. Before forwarding a request, it checks it against several layers of security:
A 1020 means one of these layers blocked the request. The error page sometimes includes a Ray ID — a unique identifier for that specific blocked request that you can use to find the exact rule that triggered it.
This is fundamentally different from a 403 Forbidden error from your origin server. A 403 means your web server rejected the request. A 1020 means Cloudflare rejected it before it ever reached your server.
The most common cause for site owners. A custom firewall rule is too broad and blocks legitimate traffic. For example, blocking an entire country when you only meant to block a specific IP range, or blocking a user agent string that matches legitimate browsers.
Cloudflare assigns a threat score to every IP address. If a visitor's IP has a high threat score (associated with spam, attacks, or suspicious activity), firewall rules that reference threat scores can block them.
Cloudflare's bot management can misidentify legitimate automated traffic as malicious. This commonly affects:
If you've set firewall rules to block traffic from specific countries, legitimate users from those countries (or users whose VPN exits in those countries) will see 1020.
Cloudflare's managed WAF ruleset can trigger on requests that look like SQL injection, XSS, or other attack patterns — even if the request is legitimate. This happens when URLs or form data contain characters that match attack signatures.
If you've configured rate limiting rules, legitimate users who make many requests in a short period (e.g., rapidly browsing multiple pages) can trigger a 1020.
Use the Ray ID from the error page to identify which rule triggered the block:
You can also check recent blocks:
# Using the Cloudflare API to check firewall events
curl -s "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/security/events?limit=10" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" | jq '.result[] | {ray_id, action, source, ip: .clientIP}'
Once you've identified the offending rule, modify it to be less aggressive. Common adjustments:
In the Cloudflare dashboard under Security > WAF > Custom rules, edit the rule to add exceptions:
# Example: Block a country but allow specific IPs
(ip.geoip.country eq "XX" and not ip.src in {203.0.113.0/24 198.51.100.0/24})
Add known-good services to your IP Access Rules (Security > WAF > Tools):
# Whitelist an IP via Cloudflare API
curl -X POST "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/firewall/access_rules/rules" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "whitelist",
"configuration": {
"target": "ip",
"value": "203.0.113.5"
},
"notes": "Monitoring service"
}'
If managed rules are causing false positives:
If legitimate bots are being blocked:
If you're a visitor seeing a 1020 error on someone else's site:
If your Cloudflare firewall rules are too aggressive, they might block legitimate visitors — including search engine crawlers and monitoring services — without you realising it. A misconfigured rule can effectively take your site offline for a segment of your users while it appears perfectly fine from your own browser.
Domain Monitor checks your site every minute from multiple locations around the world. If a Cloudflare firewall rule starts blocking requests from any of these locations, you'll be alerted immediately via email, SMS, or Slack. This is especially valuable for catching overly broad country blocks or IP reputation rules that affect real visitors. Set up downtime alerts for your key pages so you know the moment Cloudflare starts blocking traffic that should be allowed through. Regular website monitoring from diverse locations ensures you see your site the way your global audience does.
| Cause | Fix |
|---|---|
| Overly broad firewall rule | Narrow the rule scope, add exceptions |
| IP reputation block | Switch action to Challenge instead of Block |
| Bot detection false positive | Whitelist the bot or disable specific rules |
| Country block catching VPN users | Add exceptions for trusted IPs |
| WAF managed rule false positive | Disable or log the specific rule |
| Rate limiting too strict | Increase thresholds or add IP exceptions |
A 1020 is Cloudflare doing its job — protecting your site. The key is making sure it's not overprotecting and blocking the people you actually want to reach. Use the Security Events log to find exactly what's triggering blocks, then fine-tune your rules to let legitimate traffic through while still stopping the bad.
Wildcard, SAN (multi-domain), and single-domain SSL certificates cover different use cases. Here's a clear comparison to help you pick the right type — and avoid paying for coverage you don't need.
Read moreDNS resolves correctly from your office but fails for users in other countries or on different ISPs. Here's why geographic DNS inconsistency happens and how to diagnose which layer is causing it.
Read moreRegistrar lock and transfer lock are often confused — and disabling the wrong one leaves your domain vulnerable. Here's a clear breakdown of what each does and when to use them.
Read moreLooking to monitor your website and domains? Join our platform and start today.