Cloudflare error · 522

522 Connection Timed Out

522 Connection Timed Out means Cloudflare could not complete a TCP connection to your origin before its connection timer ran out. The edge is up. The handshake to your server never finished.

HTTP status codes explained · the longer reference on the blog.

What 522 means

This is Cloudflare’s code, not a registered HTTP status. Cloudflare accepted the visitor’s request, looked up the origin IP, and started a TCP connection. No handshake completed in time. The origin never received an HTTP request, so there is no application log line for these visitors.

A refusal is error 521. A connection that succeeds and then waits forever on the HTTP response is error 524. 522 is the step before HTTP. Dropped packets, a wrong route, an overloaded accept queue, or a firewall that drops instead of rejecting all look like a timeout from the outside. The homepage checker waits 10 seconds. If Cloudflare returns 522 before that, you see status 522. If the path hangs longer than the checker, you see a timeout with no status.

Common causes

  • A firewall drops Cloudflare’s packets

    An allow-list that omits Cloudflare’s ranges, or a DROP rule on port 443, never answers. The edge waits and returns 522. A REJECT rule fails faster and is usually 521.

  • The origin IP is wrong or unroutable

    The DNS record points at an address that does not route to your server, or at an anycast address that black-holes the edge. The handshake has nowhere to land.

  • The host is overloaded or not accepting

    The SYN queue is full, or the machine is stalled. Connections that used to finish now hang. SSH to the same host is slow or fails the same way.

  • MTU or a middlebox stalls the handshake

    A path that drops the packets needed to finish the handshake shows up as a timeout only from some networks. Cloudflare’s path can be one of them.

How to fix it

  • Test the port from outside the origin

    From a different network, open TCP to the origin IP on 443 and 80. If that hangs, Cloudflare will hang too. If it connects, compare the IP you tested with the DNS record Cloudflare is using.

  • Allow the edge through the firewall

    The origin must accept connections from Cloudflare on the ports you configured. Keep a default deny if you want one, and include the current Cloudflare ranges. Then retry the public URL.

  • Correct the proxied A or AAAA record

    A stale IP after a server move is a common 522. Update the record to the address that is actually listening.

  • Check the host is scheduling network work

    Look at load, the accept queue, and whether the network interface is dropping packets. A wedged host times out every edge, not only Cloudflare.

Is it your site, or just you?

522 is decided at Cloudflare before your app runs, so cookies and extensions do not matter. Confirm with a phone on cellular data. If both of you see 522, the public path is timing out.

The homepage checker follows public DNS through Cloudflare. Status 522 means our check hit the same timeout. Then test TCP to the origin IP from a network that is not your laptop, so you can tell a dead origin from a path that only fails near you.

How to monitor for 522

Monitor the public hostname and expect 200. HTTP 522 fails the check and alerts after a confirming second failure. The alert’s status is 522, which tells you the handshake failed before HTTP. When the origin accepts connections again, the next good check sends a recovery alert. Free checks run every 10 minutes.

The checker on the ismysiteup homepage requests the URL from our servers and shows the HTTP status, response time, and SSL details. No account is required, and that checker allows 5 checks per hour from the same network. A free account watches 5 URLs, each checked every 10 minutes, and sends alerts on WhatsApp, Telegram, Slack, or email. A monitor expects HTTP 200 unless you set a different expected status (100–599). One failed check is confirmed with a second check before the first alert, and a later success sends a recovery alert. Pro (every 5 minutes) and Business (every minute) are listed on the pricing page; paid checkout is not open yet.

Compare Free, Pro, and Business

Related status codes

FAQ

What does 522 connection timed out mean?

Cloudflare could not finish a TCP connection to the origin in time. Your application did not run for that request, so the app log will not explain it.

How is 522 different from 521 and 524?

521 is a connection refusal. 522 is a connection attempt that never finishes. 524 is a finished connection where the origin never completed the HTTP response.

Why is the site up for me and 522 for everyone else?

You may be on a network that reaches the origin, or you may be looking at a cached page. Check from cellular data and with the homepage checker, which does not use your ISP.