A 522 means Cloudflare could not open a connection to your origin server in time. Here is how to find the layer that is blocking it and fix it.
WebNewBiz TeamChecked against each platform's own help pages
A client site that was fine yesterday now shows a Cloudflare page that says "Error 522: Connection timed out." This happens to agencies and freelancers running sites behind Cloudflare when Cloudflare cannot open a connection to the origin server within its time limit. This guide uses Cloudflare's own troubleshooting to find which layer is blocking the connection (a firewall, the DNS record, the server itself) and fix it, in the order you would actually try.
On this page
Cloudflare sits in front of your origin server as a reverse proxy. When a visitor loads the site, Cloudflare has to open a fresh connection back to the origin. A 522 means that connection did not complete in time. Cloudflare's docs describe two timeouts: Cloudflare waits about 19 seconds for the origin to answer the initial TCP handshake, and up to 90 seconds for the origin to acknowledge the request after the connection is open. If either runs out, the visitor gets a 522.
So the fault is at the origin side, not inside Cloudflare. Your job is to work out whether something between Cloudflare and the server is dropping the connection, or whether the server itself is slow or down.
Match your symptom to the likely cause, then jump to that fix first.
| Likely cause | What points to it |
|---|---|
| Firewall or security plugin blocking Cloudflare's IPs (the top cause) | The site loads when you bypass Cloudflare (pause it or use the gray cloud), but shows 522 through Cloudflare. Often started after installing a security plugin or tightening the host firewall. |
| Wrong DNS A record | The 522 began right after a server move, IP change or new hosting account. The record in Cloudflare still points at the old IP. |
| Origin server down or overloaded | The origin is also slow or unreachable when you bypass Cloudflare. High CPU or traffic, or 522 that comes and goes under load. |
| Keep-Alive disabled at the origin | Intermittent 522, worse under traffic, even though the server looks healthy. |
The fastest way to split "Cloudflare problem" from "origin problem" is to bypass Cloudflare and see if the site still fails. That test is Fix 1.
WebNewBiz hosts your sites on Google Cloud with a CDN and SSL managed for you, so there is no origin firewall to misconfigure and no 522 to debug.
Pausing Cloudflare sends traffic straight to your origin so you can see whether the server answers at all. Cloudflare's docs say this takes five minutes or less and avoids the long propagation delay of changing nameservers.
If you prefer to test one hostname only, set that DNS record to DNS-only instead: in DNS, click the orange cloud next to the record so it turns gray, as described in Cloudflare's proxy status docs. A gray cloud means Cloudflare returns the real origin IP and does not proxy the traffic.
How to read the result: if the site loads with Cloudflare bypassed, the origin is fine and something between Cloudflare and the origin is dropping the connection, so go to Fix 2. If it still fails even with Cloudflare bypassed, the origin itself is the problem, so go to Fix 4. When you are done, re-enable the proxy (orange cloud) or unpause Cloudflare.

Cloudflare names this as the most common cause: the origin firewall, .htaccess or iptables is rate limiting or blocking Cloudflare's IP addresses, so the handshake never completes. Because all proxied traffic reaches your server from Cloudflare's IPs, blocking them blocks everyone.
Check it worked: re-enable the Cloudflare proxy and reload the site. If the 522 is gone, the firewall was the problem.
If the 522 started after a server move or IP change, Cloudflare may still be dialing the old address. Cloudflare's docs call this out directly: the origin IP in your Cloudflare DNS app must match the IP your host currently gives the server.
Check it worked: after a minute or two, reload the site. A matching record plus an open firewall usually clears the 522 together.
If the site failed even with Cloudflare bypassed in Fix 1, the server itself did not answer in time. Work through these:
Check it worked: once the server responds reliably on its own IP, re-enable the Cloudflare proxy and confirm the site loads for a fresh visitor in a private window.
Collect the following before you open a ticket: the exact time the 522 appeared, the Ray ID shown on the Cloudflare error page, the client's domain and origin IP, a note of whether the site loads with Cloudflare paused, and an MTR or traceroute from the origin. Give that to your hosting provider first, since 522 is an origin-side timeout. If the host confirms the server is healthy and reachable, raise it with Cloudflare support with the same details.
What does Cloudflare error 522 actually mean?
It means Cloudflare tried to open a TCP connection to your origin web server and did not get a reply in time. Cloudflare waits about 19 seconds for the initial handshake, and up to 90 seconds for the server to acknowledge its request. If neither happens, visitors see a 522 page. The problem is almost always at the origin or the network in front of it, not inside Cloudflare.
Why does the site load fine for me but show 522 to others?
Browsers and some networks cache pages, so you may be seeing an older copy while new visitors hit the live 522. It can also be intermittent, appearing only when the origin is busy or when a security rule drops some connections and not others. Test in a private window and from a different network, or use an external uptime check, before deciding the error is gone.
Is error 522 Cloudflare's fault or my server's fault?
Almost always the origin side. A 522 is Cloudflare reporting that your server, or a firewall in front of it, did not answer in time. The most common cause is a firewall or security plugin blocking Cloudflare's IP ranges. Other causes are a wrong DNS record, an overloaded or offline server, or Keep-Alive being disabled at the origin.
How do I check whether the problem is Cloudflare or my origin?
Pause Cloudflare on the site, or set the DNS record to DNS-only (the gray cloud), so traffic goes straight to your origin without the proxy. If the site loads when Cloudflare is bypassed, the origin is fine and something between Cloudflare and the origin, usually a firewall, is dropping the connection. If it still fails, the origin server itself is the problem.
Which Cloudflare IP ranges do I need to allow on my firewall?
Cloudflare publishes its full, current list of IPv4 and IPv6 ranges at cloudflare.com/ips. Allow every range on ports 80 and 443 for full two-way traffic, not just the first handshake packet. The list changes over time, so pull it from that page rather than from an old copy, and re-check it if 522 errors return after a while.
Chasing a 522 across a firewall, a DNS record and an overloaded server is the cost of running your own origin behind Cloudflare. If you build and host client sites and want fewer of these calls, WebNewBiz hosts each site on Google Cloud with a CDN and SSL managed for you, so there is no separate origin firewall to misconfigure and no IP ranges to whitelist. Honest limits: it is a younger platform with a smaller app ecosystem than the usual stacks, and it does not export your layout as files to another host, so moving away later means rebuilding the design. The AI's first draft still needs your own edits and photos.
You can try it for real: Create your website for $1. The first month is $1, then the plan's normal price (Starter is $19 a month), and you can cancel any time. Agencies can also talk to us about white-label. If you are keeping the site where it is, the fixes above are the full path. For related connection problems, see Cloudflare too many redirects and managing multiple client websites.
Describe your business and the AI builds your website, store and CRM. Try it free for 3 days, no card needed.