520 Web Server Returned an Unknown Error
A Cloudflare-specific code: the origin returned something Cloudflare could not interpret as a valid HTTP response.
Cloudflare received an empty, unknown, or unexpected response from the origin server.
520 is an unofficial status code used by Cloudflare. It is not part of the HTTP standard or the IANA registry.
What HTTP 520 Web Server Returned an Unknown Error Means
Cloudflare received an empty, unknown, or unexpected response from the origin server.
A Cloudflare-specific code: the origin returned something Cloudflare could not interpret as a valid HTTP response.
Common Causes
- Origin server crashed or returned an empty response
- Connection reset by the origin
- Large headers or malformed response from the origin
- Origin killed the request (timeout, OOM)
How to Fix It (For Visitors)
- Refresh the page
- Try again in a few minutes
- Contact the website owner if it persists
How to Fix It (For Developers/Admins)
- Check origin server logs and error rates
- Ensure the origin returns valid HTTP responses
- Reduce response header size
- Confirm the web server (Nginx/Apache) is healthy
How to Troubleshoot Cloudflare Errors
Every Cloudflare error page shows a Ray ID and tells you whether the browser, Cloudflare, or the origin host is failing. To test the origin directly while keeping the correct hostname, bypass Cloudflare with curl:
# Replace 203.0.113.10 with your origin server's IP
curl -svo /dev/null --resolve example.com:443:203.0.113.10 https://example.com/If this request fails or is slow, the problem is on the origin, not at Cloudflare. Also make sure your firewall, security plugins, and rate limiters allow Cloudflare's IP ranges.
Frequently Asked Questions
What does HTTP 520 Web Server Returned an Unknown Error mean?
A Cloudflare-specific code: the origin returned something Cloudflare could not interpret as a valid HTTP response. In short: Cloudflare received an empty, unknown, or unexpected response from the origin server.
Is 520 an official HTTP status code?
No. 520 is not registered in the IANA HTTP Status Code Registry; it is specific to Cloudflare. A client that receives an unrecognized status code treats it like the generic 500 code of its class.
How do I fix a 520 Web Server Returned an Unknown Error error?
Check origin server logs and error rates. Ensure the origin returns valid HTTP responses. Reduce response header size.
Specification Status
520 Web Server Returned an Unknown Error is not an official HTTP status code. It is not registered in the IANA HTTP Status Code Registry and is specific to Cloudflare. Other servers and clients may not recognize it.