What Cloudflare 520 means
Cloudflare connected to your origin, but the response made no sense: empty, malformed, or the connection was reset. Often the origin crashed while handling the request, or sent headers larger than Cloudflare accepts.
520 isn’t defined in any HTTP standard. It is specific to Cloudflare, so other servers and proxies won’t use it.
How to fix error 520
- Check the origin’s error logs at the time of the 520.
- Very large headers or cookies (over 16 KB in total) cause 520.
- Make sure the origin doesn’t block or rate-limit Cloudflare’s IP ranges.
Retrying
Yes, usually. It is often temporary, so retry with exponential backoff and give up after a few attempts.
Example response
HTTP/1.1 520 Web Server Returned an Unknown Error
Date: Wed, 21 Oct 2026 10:30:00 GMT
Server: cloudflare
CF-RAY: 8c2f6a1e3b9d4e21-FRA
Content-Type: text/html; charset=UTF-8
Related status codes
- 502 Bad Gateway : A proxy or gateway got an invalid response from the upstream server.
- 521 Web Server Is Down : The origin server refused the connection.
- 522 Connection Timed Out : The TCP connection to the origin server timed out.
Other 5xx status codes
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
See the full list of HTTP status codes.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does Cloudflare 520 Web Server Returned an Unknown Error mean?
Cloudflare 520 Web Server Returned an Unknown Error means the origin server returned an empty, unknown or unexpected response. Cloudflare connected to your origin, but the response made no sense: empty, malformed, or the connection was reset. Often the origin crashed while handling the request, or sent headers larger than Cloudflare accepts.
How do I fix Cloudflare 520?
Check the origin’s error logs at the time of the 520. Very large headers or cookies (over 16 KB in total) cause 520. Make sure the origin doesn’t block or rate-limit Cloudflare’s IP ranges.