Cloudflare reached your server, but what came back was not a usable HTTP response: nothing at all, a connection dropped mid-answer, or headers too large to pass on. It is almost always the server — an application that crashed, a firewall cutting Cloudflare off, or cookies piling up past 128 KB of headers.
Web server is returning an unknown error Error code 520
How 2 other clients word the same error
Browser tab
example.com | 520: Web server is returning an unknown error
curl -I
HTTP/2 520
| Error | Error 520: Web server is returning an unknown error |
| Usually fixed by | The site owner or host |
| Status | 520 — Cloudflare’s own code, not part of HTTP |
| Between | Cloudflare and your server; the visitor’s side is working |
| Header limit | 128 KB of response headers (32 KB until October 2025) |
Check the site from outside
Enter the address: we load it from our network and show the status code, how long it took, and the error if it failed.
What it means
Cloudflare sits between visitors and your server — the origin. It connected to the origin and sent the request, but the answer was empty, cut off or not valid HTTP, so it had nothing to pass on and showed its 520 page. The three boxes on that page say where it broke: the browser and Cloudflare “Working”, the host “Error”.
Why it happens
- The application crashed while answering — Cloudflare notes 520s are common with PHP applications that crash the web server.
- A firewall or security plugin on the server cutting Cloudflare’s addresses off mid-connection.
- Response headers over 128 KB, usually from too many or too large cookies.
- An empty reply: no status line, no headers, no body.
- HTTP/2 to Origin turned on while the server does not handle HTTP/2 properly.
- Authenticated Origin Pulls turned on without the server being set up for it.
How to fix it
- Read the web server’s and the application’s error logs at the time of the error; the Ray ID at the foot of the page identifies the request.
- Allow all of Cloudflare’s IP ranges (cloudflare.com/ips) in the server’s firewall and security plugins.
- Trim the cookies the site sets, and turn off HTTP/2 to Origin to see whether it is the cause.
- See the server’s own answer by asking it directly (the command below), or set the DNS record to DNS only for a moment.
- If it goes on, Cloudflare support asks for the URL, the Ray ID, the output of /cdn-cgi/trace and two HAR files — one with Cloudflare on, one paused.
If you are visiting the site
- Nothing on your side causes it. Try again in a few minutes; if it goes on, tell the site owner the time and the Ray ID at the bottom of the page.
See it for yourself
curl -sv -o /dev/null https://example.com/ --resolve example.com:443:203.0.113.10
Put the origin server’s own IP in place of 203.0.113.10: curl skips Cloudflare and shows what the server itself returns — an error status, a dropped connection, or oversized headers.
Questions
Is error 520 Cloudflare’s fault?
Rarely. Cloudflare shows it when your server’s answer is unusable, and the cause is on the server in almost every case — which is why Cloudflare asks for the server’s error log first.
Sources
Error text and meaning checked on 25 September 2026 against these official sources:
- Error 520 — developers.cloudflare.com
- Connection limits — developers.cloudflare.com
- IP Ranges — cloudflare.com