Troubleshooting

How to fix Cloudflare Error 522: Connection timed out

Cloudflare Error 522 means your origin server did not answer Cloudflare in time. Learn the causes, from overloaded servers to dropped packets, and how to fix error 522.

IntermediatecPanel hosting2 min read

Cloudflare Error 522 ("Connection timed out") means Cloudflare tried to open a TCP connection to your origin server and got no reply within about 15 seconds, or the connection opened but the request was not acknowledged in time. The server is either unreachable, overloaded, or silently dropping Cloudflare's traffic.

Before you start

  • Your origin IP from Cloudflare → DNS and the correct server IP from cPanel.
  • A terminal for curl, ping and traceroute.

Common causes of Cloudflare Error 522

  • An overloaded origin – high CPU, memory or account resource limits so new connections queue.
  • A firewall dropping packets from Cloudflare IPs instead of rejecting them.
  • Wrong origin IP pointing to a server that no longer exists.
  • Network routing problems between Cloudflare and the data centre.
  • KeepAlive disabled on the origin, which Cloudflare relies on to reuse connections.

How to fix error 522

  1. Verify the origin IP in Cloudflare DNS matches the server IP in cPanel → General Information.
  2. Test directly. curl -Iv --connect-timeout 10 --resolve example.com:443:ORIGIN_IP https://example.com/. A hang here confirms the origin or network.
  3. Check resource usage. In cPanel → Metrics → Resource Usage look for limit faults at the time of the errors. If you are hitting limits, see 508 resource limit reached. On a VPS, check load with top.
  4. Check firewalls. Make sure Cloudflare IP ranges are allowed in CSF, Imunify360 or your VPS firewall. On shared hosting, open a ticket.
  5. Trace the route from your computer to the origin with traceroute (tracert on Windows) to spot packet loss. See network troubleshooting tools.
  6. Enable KeepAlive on your VPS web server if it was turned off.

Note: If the 522 appears only at busy times, the cause is almost always load. Caching (for example LiteSpeed Cache) cuts the requests that reach PHP.

What to check afterwards

Monitor the site for a few hours, especially at peak times, and keep an eye on resource usage graphs.

FAQ

Is error 522 on my side or Cloudflare's?

Almost always the origin side: server, firewall or network.

How is 522 different from 524?

522 is a connection timeout; 524 means connected but the page took over 100 seconds to generate.

Can a slow plugin cause a 522?

Indirectly: if slow pages exhaust PHP workers, new connections wait and time out.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.