520 Web Server Returned an Unknown Error β
Meaning β
A Cloudflare-specific status indicating that the origin server returned an unexpected or unknown response. Itβs essentially a catch-all when the originβs response is something Cloudflare doesn't know how to handle (not a standard HTTP response).
When to Use β
Used by Cloudflare's reverse proxy service when the origin server responds with something that is empty or not recognizable as a valid HTTP response, or closes the connection unexpectedly. It tells the client that something went wrong but the details are not clear.
Example β
If Cloudflare requests content from an origin server and the server responds with gibberish or an empty response (not even headers), Cloudflare will return a 520 error to the client to indicate an unknown error at the origin.
When Not to Use β
Do not use outside of Cloudflare or similar proxy contexts. As a client or origin developer, if you see a 520, it usually means the issue is with the origin server's response, not a code you'd intentionally send. For standard servers, prefer using explicit 5xx errors.
Source β
Unofficial (Cloudflare)