HTTP 522 Connection Timed Out

Non-standard, from Cloudflare: the TCP connection to the origin timed out before it was established.

Non-standard — not defined by any RFC. Vendor documentation: Cloudflare 5xx error reference

Where you meet HTTP 522 in production

Overloaded origins that cannot accept new connections, firewalls silently dropping the CDN's packets, or routing problems between the CDN and the origin's network. It tends to cluster during traffic spikes.

Why you would test it

Distinguish it from 524 in alerts: 522 is a network or capacity problem reaching the server, 524 is a server that accepted the connection and then took too long.

What your client should do about a 522

Retry with exponential backoff and jitter — a synchronised retry storm is exactly what keeps an overloaded origin from recovering. Set your own client timeout above the CDN's connect timeout, or you will record a client timeout instead of the 522.

522 versus the codes it gets confused with

Endpoints that return 522

1 endpoint in this playground answers with 522. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 522

Is 522 a server error or a network error?
A network-level failure reported as an HTTP status: the CDN could not complete a TCP connection to the origin.
Why do retries make it worse?
If the origin is overloaded, every retry is another connection attempt. Backoff with jitter spreads them out.

Other server error codes

All HTTP status codes · All 55 mock REST APIs · Getting started guide

Last updated