--- title: "520 Web Server Returned an Unknown Error — what it means and how to fix it" description: "Cloudflare reached the origin server but got back a response it could not make sense of. What causes an HTTP 520, what to try as a visitor, and what to check if it is your own site." url: https://atoneplace.net/error/520/ site: "At One Place" --- # HTTP 520 — Web Server Returned an Unknown Error **HTTP 520: Web Server Returned an Unknown Error** Cloudflare reached the origin server but got back a response it could not make sense of. ## What 520 actually means This is not a standard HTTP status code — it is Cloudflare's, and it appears only on sites behind Cloudflare. It is the catch-all for "the origin answered, but with something empty, malformed or otherwise unexpected": a connection reset mid-response, headers that are too large, or a reply that is not valid HTTP. Because it is a catch-all, 520 is the least specific of Cloudflare's errors and usually needs the origin logs to resolve. ## Common causes - The origin server reset the TCP connection mid-response - The origin returned an empty response - Response headers exceeding Cloudflare's size limit, often from too many cookies - A malformed response that is not valid HTTP - The origin's application crashing part-way through generating a response - A firewall at the origin dropping Cloudflare's connections inconsistently ## If you're just trying to view the page 1. Reload after a moment — 520s are often intermittent 2. Nothing else on your side; this is between Cloudflare and the site's own server 3. Report it to the site owner, including the Cloudflare Ray ID shown on the error page ## If it's your site 1. Check the origin's error logs at the timestamp on the error page; the Ray ID lets you correlate exactly 2. Reduce response header size — a large number of cookies is the most common trigger 3. Confirm the origin is not resetting connections; look for crashes or `RST` packets in a `tcpdump` 4. Whitelist Cloudflare's published IP ranges at the origin firewall 5. Bypass Cloudflare temporarily (test against the origin IP directly) to confirm whether the origin is at fault ## Reference - **Status code:** 520 - **Reason phrase:** Web Server Returned an Unknown Error - **Category:** 5xx — Server Error - **Cacheable by default:** No ## Common questions ### What does HTTP 520 mean? Cloudflare reached the origin server but got back a response it could not make sense of. This is not a standard HTTP status code — it is Cloudflare's, and it appears only on sites behind Cloudflare. It is the catch-all for "the origin answered, but with something empty, malformed or otherwise unexpected": a connection reset mid-response, headers that are too large, or a reply that is not valid HTTP. ### How do I fix a 520 error? Reload after a moment — 520s are often intermittent ### Is 520 a client error or a server error? 520 is in the 5xx range, which means server error. The request was acceptable but the server could not fulfil it, so retrying later can succeed. ## Related pages - [500 Internal Server Error](https://atoneplace.net/error/500/) - [502 Bad Gateway](https://atoneplace.net/error/502/) - [503 Service Unavailable](https://atoneplace.net/error/503/) - [504 Gateway Timeout](https://atoneplace.net/error/504/) - [524 A Timeout Occurred](https://atoneplace.net/error/524/) - [521 Web Server Is Down](https://atoneplace.net/error/521/) - [522 Connection Timed Out](https://atoneplace.net/error/522/) - [525 SSL Handshake Failed](https://atoneplace.net/error/525/) - [526 Invalid SSL Certificate](https://atoneplace.net/error/526/) - [530 Origin DNS Error](https://atoneplace.net/error/530/) - [501 Not Implemented](https://atoneplace.net/error/501/) - [511 Network Authentication Required](https://atoneplace.net/error/511/) ## Sources - Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA (https://www.iana.org/assignments/http-status-codes/) - RFC 9110: HTTP Semantics — IETF (https://www.rfc-editor.org/rfc/rfc9110.html)