520: Web Server Returns an Unknown Error, what it means and what to do
This code is not part of the official HTTP standard. It comes from Cloudflare, the network that sits in front of a large share of the web, and you only see it on sites that use Cloudflare. Error 520 is Cloudflare's catch-all for the strange: the origin server returned an empty, unknown, or unexpected response that did not match any more specific failure. Cloudflare reached the server, something came back, and that something was not a usable HTTP response. Because it is the unclassified bucket, a 520 is a starting point for investigation rather than a diagnosis.
If you are just visiting a site
- Wait and retry in a few minutes. The problem sits between Cloudflare and the site's own server, and it often clears when that server recovers.
- There is nothing to fix on your device. A different browser, a cleared cache, or a restarted phone produces the same error, because your request reached Cloudflare successfully and failed after that.
- Tell the site owner through another channel if it persists, their social account or a status page. Owners often learn about origin failures from visitors first.
If it is your site behind Cloudflare
- Start with the origin's error log at the timestamp. A 520 means the response defied classification, and the origin log usually shows the crash, the killed process, or the malformed output behind it.
- Look for application crashes and resource limits. PHP workers killed for memory, applications segfaulting mid-response, and servers dropping connections under load are the recurring causes.
- Check for oversized or malformed headers. An origin that returns headers larger than Cloudflare accepts can produce a 520, a known pattern after apps start setting very large cookies or headers.
- Give Cloudflare support the Ray ID. The error page shows one. It lets Cloudflare pull the exact exchange and say what the origin actually sent.
Visitors: a 520 is the site's server answering nonsense, and patience is the only tool you have. Owners: treat 520 as unclassified on purpose, the origin log is where the real error lives.
Common questions
Why is 520 called an unknown error? Because Cloudflare genuinely cannot classify what the origin did. The connection worked, but the response was empty, malformed, or cut off in a way that matches none of the specific failures that have their own codes, such as a refused connection (521) or a timeout (522, 524).
Can a 520 be caused by my firewall or hosting limits? Yes, indirectly. Security tools that kill connections mid-response, and hosting resource limits that terminate processes, both produce the malformed or empty responses that Cloudflare buckets as 520.
Related errors