Skip to content

5xx Server error · unofficial (Cloudflare)

520 Web Server Returned an Unknown Error

Cloudflare got an empty, unknown or unexpected response from the origin server.

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

Often confused with

HTTP 520 FAQ

What does HTTP 520 mean?

520 Web Server Returned an Unknown Error: Cloudflare got an empty, unknown or unexpected response from the origin server. A Cloudflare-specific catch-all: the origin answered, but with something Cloudflare couldn't use, such as an empty reply or a connection reset.

Is 520 a client or server error?

It's a server error (5xx): the server failed to handle a valid request, so the fix is usually on the server's side.

How do I fix a 520 error?

Retry; if it persists, the site owner needs to fix their server.

Should I retry after a 520?

Yes, a few times.

Other 5xx status codes

All HTTP status codes