Non-standard, from Cloudflare: the origin answered with something Cloudflare could not interpret — an empty, malformed or unexpected response, or a reset connection.
Non-standard — not defined by any RFC. Vendor documentation: Cloudflare 5xx error reference
Behind Cloudflare, when the origin crashes mid-response, sends headers too large or malformed to parse, returns an empty reply, or resets the connection. It often appears during deploys, when a process restarts while requests are still in flight.
Test that your client treats it as a retryable upstream failure, and that your logs keep the CDN request id so the origin team can find the matching request.
Treat it like a 502: an upstream failure that may succeed on retry. Retry idempotent requests with backoff and a cap, keep the CDN request identifier (CF-Ray) in your logs, and do not retry non-idempotent requests without an idempotency key.
1 endpoint in this playground answers with 520. Every one is free, needs no signup, and can be called from the browser or with curl.
GET https://funapi.dev/api/faults/v1/status/{code} — Return any status code on demand (200–599) (Fault Injection API) Open & run this endpointAll HTTP status codes · All 55 mock REST APIs · Getting started guide
Last updated