## Summary

*"Error 522: Connection timed out"* is a Cloudflare error page. It means Cloudflare could reach its own edge but could not open or complete a connection to your origin server in time. Visitors see the Cloudflare page instead of your site, often intermittently, often only under load, and often right after a hosting move, a firewall change or a DNS edit.

This guide gives you the fast isolation steps first. If you would rather hand it over, SazM offers an affordable, low-cost Cloudflare 522 fix for a **fixed $99 price, delivered within 48 hours**, entirely in writing: no calls, no project manager, one senior developer.

## Where the Error Lives

A 522 is not logged by your application, because the request never reaches it. Evidence lives at the network and server level:

```text
/var/log/nginx/error.log          # upstream timed out, connect() failed
/var/log/nginx/access.log         # are Cloudflare requests arriving at all?
/var/log/apache2/error.log        # MaxRequestWorkers reached
/var/log/php*-fpm.log             # pm.max_children reached
/var/log/auth.log, ufw status, iptables -S   # firewall drops
Cloudflare dashboard > DNS        # the origin A/AAAA record and proxy status
```

Cloudflare's own documentation distinguishes two cases: the origin never completed the TCP handshake, or it connected but did not acknowledge the request within the timeout. Knowing which one applies narrows the cause quickly.

## Quick Fix Breakdown (DIY)

- **Confirm the origin is alive.** Test it directly, bypassing Cloudflare, with the origin IP:

```bash
curl -I --resolve example.com:443:ORIGIN_IP https://example.com/ --max-time 15
```

- **Check the DNS record.** The proxied A/AAAA record must point to the current server IP. A stale IP after a migration is a very common cause.
- **Allow Cloudflare's IP ranges.** Firewalls, security plugins, host-level rate limits and tools such as fail2ban or CSF can block Cloudflare because all visitors arrive from a few shared addresses. Allow the published ranges at `https://www.cloudflare.com/ips/` and make sure your server logs the real visitor IP via `CF-Connecting-IP` (nginx `real_ip` module) so it does not ban Cloudflare itself.
- **Make sure the web server listens on the right port.** Full SSL modes connect on 443, Flexible connects on 80. Check:

```bash
ss -tlnp | grep -E ':80|:443'
```

- **Look for overload.** If the web server or PHP is saturated, new connections are dropped and Cloudflare times out. Check load, `MaxRequestWorkers` (Apache) or `worker_connections` (nginx) and PHP-FPM `pm.max_children`.
- **Enable keep-alive on the origin.** With keep-alive disabled, every request pays a full handshake and the origin can fall behind.
- **Pause Cloudflare to compare.** Setting the record to DNS only (grey cloud) shows whether the site works without the proxy. If it fails too, the problem is the origin.
- **Check the host.** Some hosts block or throttle unfamiliar IP ranges or run security rules that treat Cloudflare as a bot network. Ask them in writing whether Cloudflare ranges are allowed.
- **Slow origin requests.** If a heavy admin or import request exceeds Cloudflare's wait, you will see a 524 (timeout after the connection was made) rather than a 522; the two are treated differently.

If none of these isolates it within an hour, stop. Every extra hour is lost orders and lost search visibility.

## Hand It Over: $99 Fixed, Within 48 Hours

A 522 drags on because the cause can sit in DNS, the firewall, the web server or the host, and each owner points at the other. One developer who checks all four ends the guessing.

What you get for **$99**:

- **A fixed price agreed before work starts.** One issue, one flat fee, no hourly meter.
- **Delivery within 48 hours** of access, with changes verified before they are left in place.
- **Fully written, fully async.** You send the domain, when it started and what changed recently (migration, firewall, plugin, traffic spike). You get questions, progress and proof in writing. There are no calls, meetings or project managers.
- **Written proof it works:** the root cause in plain language, which settings changed, a before and after check, and a rollback note.
- **Money-back guarantee** if the agreed root cause cannot be resolved.
- **Safe access only:** a limited Cloudflare, SSH or hosting account that you can revoke. Never send passwords through the inquiry form.

If the 522 is replaced by a redirect loop after you change SSL mode, see [Cloudflare ERR_TOO_MANY_REDIRECTS on WordPress](/articles/cloudflare-err-too-many-redirects-wordpress-fix). If the site shows a database error behind Cloudflare, see [Error establishing a database connection](/articles/error-establishing-a-database-connection-wordpress-fix).

Behind it: 20+ years in production (since Oct 2006) and 100+ projects in the portfolio.

**[Get this error fixed for $99 →](/ssl-redirect-loop-fix)** · [Queue an urgent fix](/checkout/emergency) · [See past projects](/projects)

For broader fixes, see [bug-fix services](/bug-fix-services).

## Frequently Asked Questions

### What does Cloudflare Error 522 mean?
Cloudflare could not establish or complete a connection to your origin server in time. The usual causes are a blocked Cloudflare IP range, a wrong origin IP, an overloaded server or a web server that is not listening on the expected port.

### Why do I get 522 only sometimes?
Intermittent 522s usually point to overload or rate limiting: the origin drops connections during traffic spikes, or a firewall occasionally blocks a Cloudflare address. Check logs at the time of failures.

### What is the difference between 522 and 524?
A 522 means the connection to the origin timed out. A 524 means the connection succeeded but the origin took too long to respond. They have different fixes.

### How much does it cost to fix a Cloudflare 522 error?
SazM fixes one issue for a fixed $99, delivered within 48 hours, with a money-back guarantee if the agreed root cause cannot be resolved. Typical agency hourly rates are higher and open-ended, while very low marketplace gig prices rarely include root-cause diagnosis, a staging test or a guarantee.

### Do I need a call to explain the problem?
No. Send the domain, the time it started and what changed recently. A written report is more precise than a call.
