HTTP 520 Cloudflare Unknown Origin Error
Cloudflare returns 520 when the origin’s response is empty, unexpected or unusable. Origin crashes, malformed responses and very large headers are among the documented causes.
Correlate the edge request with the origin
Keep the URL, timestamp and Cloudflare Ray ID from the error page. Check whether the origin saw the request and whether it emitted a valid status and headers before the connection ended. If the site is yours, compare a minimal request with the headers involved in the failing case.
Use a successful proxy probe to narrow the search
When the default IP check works and a custom site returns 520, take the Cloudflare details to the site’s operator. A refusal to open a connection to the origin has a separate Cloudflare status, 521.
See whether the response ever became HTTP
A request can reach the origin just before its process restarts. If the process closes the connection without a usable status line or headers, an edge log can show 520 while the application logs only the restart. Look for a timestamp match in the web server, reverse proxy, and application. If the response originated at another internal gateway, follow the same identifier through that gateway’s upstream logs.
Reproduce with a controlled comparison
Compare the same read-only URL with a fresh session and with the session that hit the error. Keep cookie values private and compare their sizes and the resulting response headers. A failure limited to one request profile calls for different checks than a crash affecting every visitor. When the origin emits a valid response on both paths, inspect the origin protocol settings documented for the Cloudflare connection.