Troubleshooting guide · cloudflare · Published 2026-08-14 · 3 min read

Cloudflare 522 origin connection timed out

Diagnose and fix Cloudflare 522 origin connection timed out errors. Covers firewall blocks, DNS only testing, SSL mode misconfiguration, and 521, 524 and 525 variants.

Flat editorial illustration showing a planetary shield with concentric orbit rings, one radial segment glowing as a small request dot climbs.
Illustration: this article at a glance.

Symptoms

The page shows "522: Connection timed out" when it exists on your origin. The Cloudflare edge reached out to your hosting but the origin did not reply in time. Variants of the same family: 521 (origin refused the connection), 524 (origin accepted but did not finish the response in 100 seconds), and 525 (SSL handshake to the origin failed).

Editorial close-up illustration showing a planetary shield with concentric orbit rings, one radial segment glowing as a small request dot settles.
Illustration: a closer look at the technique described above.

Common causes

How to fix

  1. Load the origin directly, bypassing Cloudflare. Temporarily set the DNS record to DNS Only (grey cloud) and test the site from a normal browser. If the origin fails on its own, the problem is the host, and the 522 is telling you the truth.
  2. Confirm your host allows Cloudflare. Many hosts now require a firewall rule that allows all Cloudflare IP ranges, or a specific toggle in the host control panel. Check the hosting docs first.
  3. Test from a different network. A rule that allows home broadband but blocks cloud IPs will fail from Cloudflare even though it works for you.
  4. Check server load and resources. top or the host dashboard tells you if the origin is swapping or out of workers. A single heavy query can time out the whole origin behind Cloudflare.
  5. Review SSL mode. For a standard origin certificate use Full; for a valid origin certificate from a CA, Full strict is correct. Flexible with an origin that redirects http to https causes a loop that can surface as 522, 525, or a redirect loop instead.
  6. Check the origin server log for refused connections during the exact time of the error. The log shows whether Cloudflare's IPs reached the application.
  7. Confirm your hosting provider has not rate-limited or IP-blocked the Cloudflare ranges after heavy crawling or scanning.

Prevention

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services