Cloudflare Error 522: Connection Timed Out
Quick answer
Error 522 means Cloudflare could not complete a TCP connection to your origin in time. The most common cause is the origin firewall blocking or rate limiting Cloudflare IPs.
Most likely fix: Allow Cloudflare IPs at the origin
How to fix it
Try these in order — the most common fix is first.
1. Allow Cloudflare IPs at the origin
- Allow all ranges from cloudflare.com/ips in .htaccess, iptables or your host firewall
- Disable rate limiting or fail2ban rules that ban those IPs
Did this fix it?2. Check the origin and its IP
- Confirm the server is not overloaded and keepalive is enabled
- In DNS, check the A record matches the IP your host assigned
Did this fix it?3. Workers and Pages cases
- For Workers on a custom domain, do not fetch your own hostname; use a route on another hostname or the global_fetch_strictly_public flag
- For Pages, confirm the custom domain CNAME points to your Pages domain
- Make sure Origin Rule hostnames do not resolve to 100:: or 192.0.2.0
Did this fix it?4. Collect evidence for support
- Run an MTR or traceroute from the origin to a Cloudflare IP seen in your logs
- Check Origin Analytics for paths with high TCP failure rates
Did this fix it?
Symptoms
Visitors see 'Error 522 Connection timed out' on a proxied site; the origin may be fine when accessed directly.
Why it happens
- Origin firewall blocking or rate limiting Cloudflare IP ranges
- Origin overloaded, offline or dropping packets
- Wrong origin IP in Cloudflare DNS
- Worker fetching its own hostname, or an Origin Rule pointing to a reserved address
This guide also covers
- cloudflare error 522
- connection timed out cloudflare
- 522 cloudflare wordpress
Still not working?
If Cloudflare keeps failing, you're not alone. See every Cloudflare problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Cloudflare errors
- Cloudflare Error 521: Web Server Is Down
- Cloudflare Error 524: A Timeout Occurred
- Cloudflare Error 525: SSL Handshake Failed
- Cloudflare Error 526: Invalid SSL Certificate
- Cloudflare Error 520: Web Server Returned an Unknown Error
- Cloudflare Error 1020: Access Denied
- Cloudflare Error 1015: You Are Being Rate Limited
- Cloudflare Error 1016: Origin DNS Error