Guides

8 min readUpdated

Cloudflare 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.

CodeWhat it meansWho caused itOrigin-side testGuide
500Internal errorOrigin, unless the page HTML mentions cloudflareRequest the origin directly; read the application logHTTP status codes
502 / 504Bad or late answer from a gatewayOrigin if branded; edge if blankcurl the origin; read the proxy error log502, 504
503Origin overloaded or refusing workOrigin, unless the page HTML mentions cloudflareCheck origin limits, worker pools, maintenance mode503
520Empty, unknown or unexpected responseOrigincurl --resolve to the origin; look for crashes, resets, headers over 128 KBError 520
521Origin refused the connectionOrigin or its firewallIs the server listening on 80 or 443? Are edge ranges allowed?Firewall configuration
522Connection to the origin timed outOrigin network or firewallLook for dropped packets and blocked edge rangesNone yet
523No route to the origin addressDNS record or routingCheck A and AAAA records; run mtr from the originTraceroute and MTR
524No response within 125 secondsOrigin applicationTime the slow request on the origin504
525TLS handshake with the origin failedOrigin TLS setupopenssl s_client with the right server nameSSL handshake failed at the origin
526Origin certificate failed validationOrigin certificateCheck expiry, hostname and the full chainCertificate checks with openssl
530Origin name not resolvable; body names a 1xxx codeOwner configurationRead the 1xxx code in the bodySee 1016, 1033
1000 / 1001DNS points to a prohibited address, or failsOwner DNS recordsPoint records at the origin, not the provider's own ranges; check that CNAME targets resolveDNS lookup
1003A provider IP address was requested directlyVisitorUse the hostname, not the IP addressNone needed
1006 to 1008Visitor's IP address bannedOwner ruleSearch security events for the IP403 Forbidden
1009Country or region blockedOwner ruleReview country and IP access rules403 Forbidden
1010Blocked on the browser's signatureOwner ruleReview Browser Integrity CheckNone yet
1015Rate limitedOwner ruleFind the rate limiting rule by Ray IDError 1015
1016Origin hostname does not resolveOwner DNS recordsLook up the origin name or CNAME targetDNS lookup
1020A security rule with a Block action matchedOwner ruleSearch security events by Ray ID403 Forbidden
1033Tunnel has no healthy connectorOwner's tunnel serviceIs cloudflared running and the tunnel active?None yet
1101 / 1102Worker exception or resource limitOwner's Worker codeRead the Workers logsNone yet
1200Too many requests queued for the originOrigin capacityAccept connections faster; cache moreNone 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.

Edge versus origin (replace the hostname and 203.0.113.10; run from a host the origin firewall allows)
# 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/trace

04The 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.

SituationCloudflare codeUsual generic statusWhat nginx logs as the proxy
Origin reset the connection520502recv() failed (104: Connection reset by peer) while reading response header from upstream
Origin sent something that is not HTTP520502 or a broken replyupstream sent no valid HTTP/1.0 header while reading response header from upstream
Origin refused the connection521502connect() failed (111: Connection refused) while connecting to upstream
Origin answered too slowly524504upstream timed out (110: Connection timed out) while reading response header from upstream
Origin certificate untrusted526502upstream SSL certificate verify error: (10:certificate has expired) while SSL handshaking to upstream
Client exceeded a rate limit1015429, or 503 with nginx's default limit_req_statuslimiting requests, excess: 1.000 by zone "one"
Request blocked by a rule1020403access 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

Many websites sit behind Cloudflare as a reverse proxy, so the error page comes from the provider's edge rather than the site's own servers. The 52x codes mean the edge got no usable answer from the site's server; most 1xxx codes mean the edge refused the request under a rule or setting the site owner controls.

No. Cloudflare's documentation says its support assists only the domain owner and cannot override the security settings a customer chose. As a visitor, contact the website itself and include the time, the page address and the Ray ID printed on the error page. With those three details the owner can find your request and the rule or failure behind it.

A Ray ID is the identifier Cloudflare gives each request on its network. It is printed on error pages, returned in the cf-ray response header and forwarded to the origin, so owners can match a visitor's report to security events and server logs. Ray IDs are not guaranteed to be unique, so always give the time too.

Usually not. Codes 520 to 526 report a problem between the edge and one website's origin, so they affect that site alone. A provider incident shows up as errors on many unrelated sites at once and on the public status page. A blank, unbranded 502 or 504, or a 500 or 503 mentioning cloudflare in its HTML, points to the edge.

No. The numbers are specific to this provider: 520 to 530 are not registered HTTP status codes, and the 1xxx codes are labels inside the page body. Other CDNs and reverse proxies report the same failures with standard codes, typically 502 for a broken origin response, 504 for a timeout, 403 for a blocking rule and 429 for a rate limit.

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.

  1. 01Cloudflare 5xx errors · Cloudflare docs
  2. 02Cloudflare 1xxx errors (with the HTTP status of each code) · Cloudflare docs
  3. 03Error 1006, 1007, 1008 or 1106 (support cannot override a customer's security settings) · Cloudflare docs
  4. 04Error 502 bad gateway or error 504 gateway timeout · Cloudflare docs
  5. 05Error 520 · Cloudflare docs
  6. 06Error 522 · Cloudflare docs
  7. 07Connection limits · Cloudflare docs
  8. 08Cloudflare Ray ID · Cloudflare docs
  9. 09Troubleshooting Cloudflare 5XX errors, including 527 Railgun Listener to origin error (archived 5 January 2022) · Internet Archive
  10. 10Cloudflare is deprecating Railgun · Cloudflare blog
  11. 11Cloudflare outage on November 18, 2025 · Cloudflare blog
  12. 12ChatGPT down: what to do if you are asked to unblock Cloudflare (18 November 2025) · Yahoo Finance UK
  13. 13Hypertext Transfer Protocol (HTTP) Status Code Registry · IANA
  14. 14Module ngx_http_limit_req_module (limit_req_status) · nginx.org

Last updated