What 520 means
A Cloudflare-specific catch-all: the origin answered, but with something Cloudflare couldn't use, such as an empty reply or a connection reset.
Common causes
- The origin crashed or reset the connection.
- Response headers too large (over 128 KB).
- The origin returned an empty response.
How to fix it
If you're calling an API
- Retry; if it persists, the site owner needs to fix their server.
If you run the server
- Check origin logs for crashes and resets; whitelist Cloudflare's IP ranges.
Should you retry?
Yes, a few times.
Example response
HTTP/1.1 520 Web Server Returned an Unknown Error
Content-Type: application/problem+json
{
"type": "about:blank",
"title": "Web Server Returned an Unknown Error",
"status": 520,
"detail": "Cloudflare got an empty, unknown or unexpected response from the origin server."
}Defined in: Cloudflare (non-standard). 520 is a server error: the problem is on the server's side.
Debugging an API call? Convert your request with the cURL converter, check the response with the JSON formatter, or see whether the API is down on its status page.