Non-standard, from Cloudflare: the origin server refused the connection — it is down, or a firewall is blocking the CDN's addresses.
Non-standard — not defined by any RFC. Vendor documentation: Cloudflare 5xx error reference
When the origin web server process is stopped, the host is down, or a firewall or security group only allows a list of addresses that does not include the CDN's. A spike of 521s right after an infrastructure change usually points at the firewall.
An origin outage seen through a CDN. Retry with backoff, show a maintenance message, and alert on it: unlike a single 500 it means nothing behind the CDN is answering.
The origin is not accepting connections, so every request will fail until it is back. Back off and retry slowly, show a maintenance or offline state rather than an error per action, and alert: this is an outage, not a bad request.
1 endpoint in this playground answers with 521. 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