Guides
8 min readUpdatedCloudflare error codes: what each one means and how to fix it
Quick answer
Cloudflare error codes tell you which side of a request failed. The 52x codes, 520 to 530, mean the edge reached for the website's origin server and got an empty, refused, late or untrusted answer, so the fix is on the origin. The 1xxx codes appear in the page body and mostly mean the edge refused the request itself, because of an owner's rule, a DNS mistake or a platform limit. Visitors can fix very few.
01How do you read a Cloudflare error code?
Start with the number family, because it tells you who has to act. The 5xx codes travel in the HTTP status line, so they show up in browser tools, logs and monitoring. The 1xxx codes sit in the HTML body and travel with an ordinary status: 1015 is sent as 429, 1020 as 403, and 1016 and 1033 as 530.
A 502 or 504 on a Cloudflare-branded page was passed on from the origin; a blank, unbranded one came from Cloudflare itself. The codes 520 to 530 are not registered HTTP statuses at all, since the IANA registry lists 512 to 599 as unassigned. Every error page also shows a Ray ID, the request identifier a site owner needs to find the request in security events or origin logs.
02Cloudflare error codes by who caused them
"Origin" means the edge reached the origin and got a bad answer or none; "owner rule" means the edge enforced a setting the site owner chose. The test is the quickest check that confirms or rules out the cause.
| Code | What it means | Who caused it | Origin-side test | Guide |
|---|---|---|---|---|
| 500 | Internal error | Origin, unless the page HTML mentions cloudflare | Request the origin directly; read the application log | HTTP status codes |
| 502 / 504 | Bad or late answer from a gateway | Origin if branded; edge if blank | curl the origin; read the proxy error log | 502, 504 |
| 503 | Origin overloaded or refusing work | Origin, unless the page HTML mentions cloudflare | Check origin limits, worker pools, maintenance mode | 503 |
| 520 | Empty, unknown or unexpected response | Origin | curl --resolve to the origin; look for crashes, resets, headers over 128 KB | Error 520 |
| 521 | Origin refused the connection | Origin or its firewall | Is the server listening on 80 or 443? Are edge ranges allowed? | Firewall configuration |
| 522 | Connection to the origin timed out | Origin network or firewall | Look for dropped packets and blocked edge ranges | None yet |
| 523 | No route to the origin address | DNS record or routing | Check A and AAAA records; run mtr from the origin | Traceroute and MTR |
| 524 | No response within 125 seconds | Origin application | Time the slow request on the origin | 504 |
| 525 | TLS handshake with the origin failed | Origin TLS setup | openssl s_client with the right server name | SSL handshake failed at the origin |
| 526 | Origin certificate failed validation | Origin certificate | Check expiry, hostname and the full chain | Certificate checks with openssl |
| 530 | Origin name not resolvable; body names a 1xxx code | Owner configuration | Read the 1xxx code in the body | See 1016, 1033 |
| 1000 / 1001 | DNS points to a prohibited address, or fails | Owner DNS records | Point records at the origin, not the provider's own ranges; check that CNAME targets resolve | DNS lookup |
| 1003 | A provider IP address was requested directly | Visitor | Use the hostname, not the IP address | None needed |
| 1006 to 1008 | Visitor's IP address banned | Owner rule | Search security events for the IP | 403 Forbidden |
| 1009 | Country or region blocked | Owner rule | Review country and IP access rules | 403 Forbidden |
| 1010 | Blocked on the browser's signature | Owner rule | Review Browser Integrity Check | None yet |
| 1015 | Rate limited | Owner rule | Find the rate limiting rule by Ray ID | Error 1015 |
| 1016 | Origin hostname does not resolve | Owner DNS records | Look up the origin name or CNAME target | DNS lookup |
| 1020 | A security rule with a Block action matched | Owner rule | Search security events by Ray ID | 403 Forbidden |
| 1033 | Tunnel has no healthy connector | Owner's tunnel service | Is cloudflared running and the tunnel active? | None yet |
| 1101 / 1102 | Worker exception or resource limit | Owner's Worker code | Read the Workers logs | None yet |
| 1200 | Too many requests queued for the origin | Origin capacity | Accept connections faster; cache more | None yet |
03How to tell whether the edge or the origin failed
As the site owner, ask your origin directly, without going through the edge, using the hostname the edge uses. curl's --resolve option pins a hostname to an address for one command, so the request carries the real Host header and TLS server name.
If the direct request fails the same way, the origin is the problem. If it succeeds, look at what differs for the edge: its source addresses, which firewalls, fail2ban or per-IP limits may block; its protocol, such as HTTP/2 or TLS towards the origin; or an outdated origin address in the provider's DNS settings.
# 1. through the edge: status line, server and the Ray ID
curl -sI https://www.example.com/ | grep -iE '^(HTTP|server|cf-ray)'
# 2. straight to the origin, with the real hostname and SNI
curl -sv -o /dev/null --resolve www.example.com:443:203.0.113.10 https://www.example.com/
# 3. the TLS handshake on its own (525 and 526)
openssl s_client -connect 203.0.113.10:443 -servername www.example.com </dev/null
# 4. what the edge saw of your own connection
curl -s https://www.example.com/cdn-cgi/trace04The 52x codes: the edge reached for the origin and failed
The 52x codes are the edge reporting on the origin, and they split by where things went wrong. Cloudflare's guidance is to check every hop between the edge and the application, because the cause is not always in the web server's logs: load balancers, caches, proxies and firewalls in between can be responsible.
- Connection: 521 is a refused connection. 522 is no answer: the edge waits 19 seconds for a SYN-ACK, resending the SYN after 1, 1, 1, 1, 1, 2, 4 and 8 seconds (which add up to 19), or 90 seconds for the request to be acknowledged. 523 is no route at all.
- Response: 520 is an unusable answer, such as an empty reply, a reset or headers over 128 KB. 524 is no response within the 125-second proxy read timeout.
- TLS: 525 is a failed handshake in Full or Full (strict) mode; 526 is a certificate that failed validation in Full (strict) mode.
- Others: 530 carries a 1xxx code in its body. 527 was the Railgun listener error; Cloudflare ended Railgun support on 31 January 2024, and the code is no longer documented.
05The 1xxx codes: the edge refused the request
Most 1xxx codes mean the request stopped at the edge and never reached the origin, so origin logs show nothing. Each group has its own fix.
- Owner rules, such as 1005, 1006 to 1008, 1009, 1010, 1012, 1015 and 1020: search the security events log for the Ray ID to see which rule acted, then change it. Cloudflare states that its support cannot override a customer's security settings. Rate limits are covered in the error 1015 guide.
- Configuration, such as 1000, 1001, 1004, 1014 and 1016: compare the DNS records and hostname setup with what the origin really uses.
- Platform, such as 1033 (a tunnel without a healthy connector), 1101 and 1102 (Worker failures), 1025 (Workers plan limits) and 1200 (requests queued for a slow origin): read the logs of that feature.
06Challenge pages and "unblock challenges.cloudflare.com"
A challenge page is not an error code. It asks the browser to prove it is a real browser and needs JavaScript and cookies; when its check cannot load, the page asks the visitor to unblock challenges.cloudflare.com, the domain the check loads from. An extension, DNS filter or network on the visitor's side is almost always the cause, and how to unblock challenges.cloudflare.com gives the rule for each blocker.
The message also appeared widely during Cloudflare's outage of 18 November 2025, which its post-mortem dates from 11:20 UTC; nothing on the visitor's side could help then. What is a CAPTCHA explains how such checks work.
07What the same failures look like behind other reverse proxies
The numbers are provider-specific; the failures are not. Any reverse proxy or CDN in front of an origin meets the same situations and reports them with standard codes. The nginx lines below were reproduced on nginx 1.22.1 against deliberately broken test backends.
| Situation | Cloudflare code | Usual generic status | What nginx logs as the proxy |
|---|---|---|---|
| Origin reset the connection | 520 | 502 | recv() failed (104: Connection reset by peer) while reading response header from upstream |
| Origin sent something that is not HTTP | 520 | 502 or a broken reply | upstream sent no valid HTTP/1.0 header while reading response header from upstream |
| Origin refused the connection | 521 | 502 | connect() failed (111: Connection refused) while connecting to upstream |
| Origin answered too slowly | 524 | 504 | upstream timed out (110: Connection timed out) while reading response header from upstream |
| Origin certificate untrusted | 526 | 502 | upstream SSL certificate verify error: (10:certificate has expired) while SSL handshaking to upstream |
| Client exceeded a rate limit | 1015 | 429, or 503 with nginx's default limit_req_status | limiting requests, excess: 1.000 by zone "one" |
| Request blocked by a rule | 1020 | 403 | access forbidden by rule |
08What can a visitor do about a Cloudflare error?
- 52x codes: wait a minute or two and reload once; the origin has to recover.
- Owner-rule codes such as 1006, 1009 or 1020: send the website the time, the page address and the Ray ID.
- 1015: stop reloading, close anything that refreshes the page automatically, and wait.
- A challenge that never loads: allow challenges.cloudflare.com in your blocker.
- 1003: use the site's name rather than an IP address.
- Many unrelated sites failing at once: check the provider's public status page.
Questions
Frequently asked questions
Sources
Sources and verification
The curl 7.88.1 and OpenSSL 3.0.22 commands were run against example.com, and every nginx log line in the comparison table was reproduced with nginx 1.22.1 against local test backends (and expired.badssl.com for the certificate error), on Debian 12, October 2026. Cloudflare behaviour is quoted from its documentation as published in October 2026.
- 01Cloudflare 5xx errors · Cloudflare docs
- 02Cloudflare 1xxx errors (with the HTTP status of each code) · Cloudflare docs
- 03Error 1006, 1007, 1008 or 1106 (support cannot override a customer's security settings) · Cloudflare docs
- 04Error 502 bad gateway or error 504 gateway timeout · Cloudflare docs
- 05Error 520 · Cloudflare docs
- 06Error 522 · Cloudflare docs
- 07Connection limits · Cloudflare docs
- 08Cloudflare Ray ID · Cloudflare docs
- 09Troubleshooting Cloudflare 5XX errors, including 527 Railgun Listener to origin error (archived 5 January 2022) · Internet Archive
- 10Cloudflare is deprecating Railgun · Cloudflare blog
- 11Cloudflare outage on November 18, 2025 · Cloudflare blog
- 12ChatGPT down: what to do if you are asked to unblock Cloudflare (18 November 2025) · Yahoo Finance UK
- 13Hypertext Transfer Protocol (HTTP) Status Code Registry · IANA
- 14Module ngx_http_limit_req_module (limit_req_status) · nginx.org
Last updated