Cloudflare error 522 means Cloudflare could not finish connecting to your web server in time. Visitors see an error page instead of your site. Because the page carries Cloudflare’s logo, many owners blame Cloudflare first. In most cases, though, the fault sits on the server side, and a firewall is the usual suspect. Searches for 522 and its sibling errors rose sharply this autumn, so here are the timeouts behind them, the common causes and what to hand your host.

Cloudflare error 522 is a connection timeout between Cloudflare and your origin server. Cloudflare waits 19 seconds for the server to answer a connection request and 90 seconds for the first data after that. The most common cause is a firewall that blocks or rate limits Cloudflare’s IP addresses. Errors 520, 521, 523, 524, 525 and 526 point at other faults on the same path.

We read Cloudflare’s documentation for each 5xx error on 26 November 2026. The timeouts and causes below come from those pages.

What Cloudflare error 522 means

The two timeouts behind it

Every request to a proxied site passes through Cloudflare. Cloudflare then opens its own connection to your server. Cloudflare’s error 522 page names two points where that connection can time out.

First, Cloudflare sends the opening packet of a TCP connection and waits 19 seconds for a reply, retrying at set intervals. Second, once the connection exists, it waits 90 seconds for any data above the TCP layer. The first message of a TLS handshake is one example. Either silence ends in the same error page.

The difference still tells you something. A missing reply to the first packet suggests a firewall dropping traffic or a server that is down. A connection that opens and then goes quiet points at a server too busy to answer.

Where to look first

Cloudflare’s documentation names one cause above all others. Cloudflare’s IP addresses get blocked or rate limited on the server. That can happen in an .htaccess file, in iptables, in a hosting firewall or in a security plugin. All your visitors now arrive from Cloudflare’s addresses, so a server under attack may start treating those addresses as the attacker.

Ask your host whether its firewall limits requests per IP address. Cloudflare’s addresses carry far more traffic than any single visitor, so a limit set for people can trip on Cloudflare.

So start at the origin. Cloudflare’s own network rarely sits at the root of a Cloudflare error 522, and its status page will show if it does.

The causes of Cloudflare error 522

Server and firewall causes

The error 522 page lists several causes beyond the firewall. An overloaded or offline server drops incoming requests. Keepalives may be turned off on the web server. Packets can also be dropped on the way into the server.

Then there is the DNS record. The origin IP address in your Cloudflare DNS may no longer match the one your host gave the server. That often happens after a migration, when the old address stays behind in Cloudflare. The result is a Cloudflare error 522 for every visitor, while the new server sits idle.

Causes on Cloudflare’s own platform

A few causes are specific to Cloudflare’s developer products. For example, a Cloudflare Pages site needs a custom domain set up, with its CNAME record pointing at the Pages domain. A Worker on a custom domain that fetches its own hostname also triggers a Cloudflare error 522. In addition, an Origin Rule that points at a hostname resolving to a reserved address produces it too.

The list is long. Even so, most cases on ordinary hosting end after a handful of checks, in the order below.

Decision diagram for diagnosing Cloudflare error 522 by checking whether the origin server answers directly
Finding the side of the connection that fails View full-size diagram

Fixing Cloudflare error 522 step by step

The checks in order

Work through these checks in order and note what you find at each one. The notes save time if you end up calling your host.

  1. Load the site straight from the server’s IP address, for example with curl -I --resolve example.com:443:<origin-ip> https://example.com.
  2. Compare the origin IP in your Cloudflare DNS records with the IP your hosting account shows.
  3. Allow every range on Cloudflare’s published IP list in the server firewall and any security plugin.
  4. Remove any rate limits that apply to those ranges.
  5. Look at server load and the web server’s error logs for the times the errors appeared.
  6. On Cloudflare Pages or Workers, check the custom domain and any code that fetches the site’s own hostname.

Reading the result

The first check splits a Cloudflare error 522 in two. If the server answers directly but not through Cloudflare, a firewall is the prime suspect. If it does not answer directly either, the server itself has a problem, and Cloudflare is only reporting it.

A server that answers slowly sits in between. It may respond to your test and still time out under real traffic. In that case, look at capacity and at whatever else runs on the machine. Write down the exact time of each test as well, since hosts search their logs by timestamp.

Reporting a Cloudflare error 522 to your host

Hosts solve these faster with the right details. Cloudflare’s 5xx overview asks you to share the exact error code and message. Add the time and timezone when it occurred, and the URL that failed. Cloudflare also notes that the cause is not always in the web server’s own logs. Load balancers, caches, proxies and firewalls between Cloudflare and the server keep logs too.

The other Cloudflare host errors

Errors 520 to 526 at a glance

Cloudflare error 522 has six close relatives in the same family. Each one points at a different stage of the trip from Cloudflare to your server.

ErrorWhat Cloudflare says happenedFirst thing to check
520The origin returned an empty, unknown or unexpected responseCrashes, malformed responses or headers over 128 KB
521The origin refused the connectionWhether the web server runs and allows Cloudflare IPs
523The origin is unreachableThe A and AAAA records and the network route
524The origin connected but sent no response within 125 secondsSlow pages, long reports or heavy database queries
525The SSL handshake failed under Full or Full (Strict) modeThe certificate, port 443 and SNI support
526The origin certificate is invalid under Full (Strict) modeExpiry, the hostname on the certificate and who signed it

What the siblings usually mean

Error 520 is the vaguest of the group. Cloudflare lists crashes, empty responses, a wrong HTTP/2 setup and response headers over 128 KB, often from too many cookies. Cloudflare’s note says 520 errors are common with certain PHP applications that crash the web server.

Error 521 often follows a crash of the web server process, or a firewall that rejects Cloudflare outright. Cloudflare also notes that Full or Full (Strict) SSL mode needs a server that accepts HTTPS.

Error 523 is about routing. One example in Cloudflare’s documentation comes from AWS. A broad route such as 172.0.0.0/8 in a VPC route table can capture traffic meant for Cloudflare, because Cloudflare uses public addresses in 172.64.0.0/13.

Error 524 is easy to confuse with a Cloudflare error 522. Here the connection succeeds, yet the server takes longer than the 125-second default to send a response. Long exports and reports are typical culprits, and moving that work into a background job is usually the lasting fix.

Errors 525 and 526 concern the encrypted link between Cloudflare and your server. They appear when the SSL mode is Full or Full (Strict) and the server’s certificate does not pass. Cloudflare suggests a Cloudflare Origin CA certificate on the server as one fix. Switching from Full (Strict) to Full only hides the problem, so treat it as a short stopgap.

Errors that do not come from your server

Unlike Cloudflare error 522, some errors start in Cloudflare’s own products. Error 1033 means a Cloudflare Tunnel has no healthy connector, which our Cloudflare Tunnel guide explains. A Worker on the free plan that passes its daily request limit returns error 1027. Error 1103 appears when a Workers spending limit blocks new requests.

These look like outages to visitors, yet the fix lives in your Cloudflare account. Check the dashboard before you call your host about any of them.

Preventing Cloudflare error 522

Most repeat cases come from firewalls that forget Cloudflare. The published IP list can change, so automate the allowlist from it. Treat any manual copy as a short-term measure. Also make sure any intrusion prevention on the server leaves those ranges alone.

Keepalives matter too. Cloudflare lists disabled keepalives among the causes, so leave them on in the web server configuration. Finally, give the server some headroom. A machine that runs at full load in busy hours will time out under the next spike.

Then watch for errors before visitors report them. Cloudflare’s Error Analytics, under HTTP Traffic in the dashboard, breaks errors down by code, URL and data centre. It works from a 1% sample of traffic. A spike in Cloudflare error 522 there usually shows up before the phone starts ringing.

For a server you control, a Cloudflare Tunnel removes the inbound firewall path altogether. The firewall causes of the error then no longer apply. A stopped connector shows up as error 1033 instead, which is quicker to diagnose.

Four-step diagram of fixing Cloudflare error 522, from testing the origin directly to checking server load and error logs
The first four checks for a 522 error, in order View full-size diagram

Repeated host errors usually trace back to firewall rules, overloaded services or certificates nobody is watching. Our server security analysis reviews firewall rules, open ports, running services, logging and patch levels on Linux and Windows servers. The full tier fixes what we find, tunes the firewall and runs a verification scan 30 days later. If Cloudflare error 522 keeps coming back on your site, see our server security analysis or use the quote request form .

Request a Quote

Frequently Asked Questions

What does Cloudflare error 522 mean?
Cloudflare timed out while connecting to your server. It waits 19 seconds for a reply to its connection request and 90 seconds for the first data after the connection opens.
Is Cloudflare error 522 my host’s fault?
Usually the cause sits on the server side. Cloudflare’s documentation names blocked or rate-limited Cloudflare IP addresses as the most common cause, followed by overloaded or offline servers.
How is 522 different from 524?
A 522 means the connection itself timed out. A 524 means the connection worked, yet the server sent no response within the 125-second default.
What is the difference between 521 and 522?
A 521 means the server actively refused the connection. A 522 means it never answered in time.
Can I bypass Cloudflare to test the server?
Cloudflare’s documentation mentions switching a record to DNS only or pausing Cloudflare as temporary workarounds. Both expose the server’s IP address, so testing with curl and the resolve option is safer.
Does a Cloudflare Tunnel stop these errors?
A tunnel removes the inbound firewall path, so firewall-related timeouts stop. A stopped connector then shows up as error 1033 instead.