Error 520: Web server is returning an unknown error
The website's server answered Cloudflare with something unusable: nothing at all, a broken response, or a connection reset.
Quick checks
- As a visitor: reload later.
- As the owner: check origin logs at the time of the error; note the Ray ID from the error page.
If you’re visiting the site
Retry
- Reload after a minute. Clearing the site's cookies sometimes helps when large cookies trigger it.
If you run the site
Look for crashes and resets
- Application crashes that close the connection without a response produce 520.
- Check web-server and app logs for errors at the Ray ID's timestamp.
Check header sizes
- Cloudflare rejects origin responses with headers over 128 KB in total (often huge Set-Cookie lists).
Test the origin directly
curl -v --resolve example.com:443:ORIGIN_IP https://example.com/shows exactly what the origin returns.
Still not working?
If you can't find the cause, open a ticket with Cloudflare including the Ray IDs, timestamps and the origin's logs.
See what’s happening
LightAtom's connections view helps when testing an origin on your Mac: you see the connections Cloudflare's tunnel or your proxy opens.
Frequently asked questions
What does Cloudflare error 520 mean?
The origin returned an empty, unknown or unexpected response. It's Cloudflare's catch-all when the origin misbehaves in a way no specific code describes.
Can large cookies cause error 520?
Yes. Response headers above Cloudflare's limits, often from many or large Set-Cookie headers, can trigger 520. Clearing cookies may help visitors temporarily.
Is 520 the same as 502?
Similar idea: both mean a bad response from upstream. 520 is Cloudflare's own code for an origin response it can't interpret.