What 522 means
Unofficial, used by Cloudflare. Cloudflare timed out contacting the website’s own server: either the connection couldn’t be set up, or the server didn’t acknowledge the request once connected.
When servers send it
When the origin is overloaded, offline, dropping packets, or silently blocking Cloudflare. Cloudflare’s docs give 19 seconds for the connection and 90 seconds for the acknowledgement.
Common causes
- A firewall silently dropping (rather than refusing) Cloudflare’s traffic.
- An overloaded origin that can’t accept new connections.
- The wrong origin IP address in Cloudflare’s DNS settings.
- Keepalives disabled at the origin.
How to fix it as a developer
- Check the A or AAAA record in Cloudflare points at the origin’s current IP address.
- Allow Cloudflare’s IP ranges at every firewall in front of the origin.
- Check the origin’s load: CPU, memory, connection limits.
How to fix it as a visitor
- Try again in a few minutes.
Related codes
- 521 Web Server Is Down: The website’s server refused Cloudflare’s connection.
- 523 Origin Is Unreachable: Cloudflare can’t find a route to the website’s server at all.
- 524 A Timeout Occurred: Cloudflare connected to the website’s server, but it took too long to send a response.
- 504 Gateway Timeout: A proxy or load balancer gave up waiting for the server behind it to reply.
Where it’s defined
522 isn’t in any RFC or the IANA status code registry. It’s used by Cloudflare. Reference: Cloudflare docs: error 522.
Other 5xx codes
500 Internal Server Error · 501 Not Implemented · 502 Bad Gateway · 503 Service Unavailable · 504 Gateway Timeout · 505 HTTP Version Not Supported · 511 Network Authentication Required · 520 Web Server Returned an Unknown Error · 521 Web Server Is Down · 523 Origin Is Unreachable · 524 A Timeout Occurred · 525 SSL Handshake Failed · 526 Invalid SSL Certificate
Or search them all in the HTTP status code list.