Web Server Returned an Unknown Error — the origin sent unexpected responses to the proxy
What 520 Means
The 520 error on the Cloudflare Edge-Errors indicates web server returned an unknown error — the origin sent unexpected responses to the proxy. This typically occurs due to origin server crashed mid-response.
The 520 response is a catch-all response used when the edge proxy network successfully connects to the origin web server, but the server responds with something that fundamentally violates the HTTP protocol or drops the connection abruptly.
Technical Background
The 520 status is highly specific to the the proxy proxy ecosystem. It prevents the edge network from passing fundamentally broken connection states or malformed garbage protocols downstream to the browser.
Because 520 acts as a generic net for 'unknown' anomalies, it is notoriously difficult to diagnose. The origin server is technically healthy enough to accept the initial TCP connection, but the application layer fails catastrophically during the response phase.
Diagnosing this consistently requires bypassing the proxy temporarily. By sending requests directly to the origin IP address, administrators can observe the raw, unstructured failure before the proxy intercepts and converts it into a 520 error screen.
Common Causes
- Origin server crashed mid-response
- Connection reset by a firewall at the origin
- Empty response body returned by the web application
- Exceedingly large response headers from the origin server
Typical Scenarios
- A PHP process crashes and closes the socket while the proxy is waiting for the page HTML
- A strict firewall silently drops established connections it flags as aggressive
- An application produces headers exceeding the proxy's size limit
What to Know
A 520 error firmly indicates that the application or server configuration behind Cloudflare is deeply unstable. Repeated 520 events frequently correlate with memory exhaustion, aggressive security appliance drops, or bad gateway scripts crashing silently.
Frequently Asked Questions
Common questions about Cloudflare 520 error
It means the proxy connected to your hosting server, but your server responded with an empty, incomplete, or corrupted message that the proxy could not understand.
Almost never. the proxy generates the friendly error page, but the root cause is an unexpected crash or bad data originating from the web server behind the proxy.
You must review the error logs on your origin host. The most common issues are crashing workers, overly aggressive firewalls, or exceeding strict header size limits.