Cloudflare Error 520 Web Server Returned an Unknown Error
Cloudflare error 520 means the origin server returned an empty, unknown or unexpected response to Cloudflare. It is a catch-all: the origin crashed, reset…
Quick answer
Cloudflare error 520 means the origin server returned an empty, unknown or unexpected response to Cloudflare. It is a catch-all: the origin crashed, reset the connection, sent oversized headers or returned something Cloudflare could not parse.
Last updated · Maintained by FreeAIToolz · How we test
What does Cloudflare Error 520 Web Server Returned an Unknown Error mean?
Cloudflare reached your server but the response was invalid. Common triggers are an app crash, headers larger than Cloudflare’s limit (around 128 KB total), a firewall resetting Cloudflare’s connections, or an empty reply.
| Status code | 520 |
|---|---|
| Name | Web Server Returned an Unknown Error |
| Class | 5xx Server Error |
| Defined in | Cloudflare (non-standard) |
| Safe to retry automatically? | Yes, with backoff |
What causes Cloudflare Error 520?
- The origin app crashed or closed the connection.
- Response headers too large (many Set-Cookie headers).
- A firewall or security module blocking Cloudflare IP ranges.
How do I fix Cloudflare Error 520?
- Check origin server logs at the time of the error.
- Allow Cloudflare IP ranges in the origin firewall.
- Reduce response header size (fewer or smaller cookies).
- Pause Cloudflare briefly to see the origin’s raw response.
What should a client do after Cloudflare Error 520?
Retry; if persistent, the site owner must fix the origin.
Does Cloudflare Error 520 affect SEO?
Googlebot sees it as a 5xx error. Persistent 520s reduce crawling and can remove pages from the index.
Other 5xx status codes
The server failed to fulfil a valid request. Retrying later, with backoff, is usually reasonable.
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 507 Insufficient Storage
- 508 Loop Detected
- 511 Network Authentication Required
- 521 Web Server Is Down
- 522 Connection Timed Out
- 523 Origin Is Unreachable
- 524 A Timeout Occurred
- 525 SSL Handshake Failed
- 526 Invalid SSL Certificate
Frequently asked questions
Is error 520 a Cloudflare problem?
How do I debug Cloudflare 520?
Is 520 a client or server error?
Related
- 521 Web Server Is Down Cloudflare error 521 means Cloudflare could not connect to your origin server because the connection was refus.
- 522 Connection Timed Out Cloudflare error 522 means Cloudflare’s TCP connection to your origin server timed out before it was establish.
- 502 Bad Gateway HTTP 502 Bad Gateway means a server acting as a gateway or proxy (Nginx, a load balancer, Cloudflare) got an i.
- 500 Internal Server Error HTTP 500 Internal Server Error is a generic server-side failure: something went wrong in the application or se.
- Open the HTTP Status Codes Reference → Free, no signup.