Error 522: Connection Timed Out (Cloudflare)
Updated Free mock REST & WebSocket APIs
Error 522 Connection Timed Out — Cloudflare's TCP connection to the origin timed out before it was established.
- Class
- 5xx Server Error
- Defined in
- Unofficial (Cloudflare)
- Official
- No — Cloudflare-specific
- Cacheable by default
- No (unless Cache-Control/Expires say so)
- Safe to retry
- Yes, after a delay (respect Retry-After)
Try it: get a real 522 response
Our test endpoint answers every request with 522 Connection Timed Out.
curl -i https://mockfox.dev/api/status/522Use it in tests, health-check monitors or to see how your client handles a 522. Add ?delay=2000 to slow it down.
What does error 522 mean?
Error 522 "Connection timed out" is a Cloudflare status meaning Cloudflare couldn't establish a TCP connection to the origin server in time (about 15 seconds) — the SYN went unanswered — or the connection was established but the origin didn't acknowledge Cloudflare's request within 90 seconds.
When is 522 used?
- The origin server is overloaded and can't accept new connections.
- A firewall silently drops (rather than rejects) packets from Cloudflare.
- The DNS record in Cloudflare points to the wrong IP address.
- Network routing problems between Cloudflare and the host.
Common causes of error 522
- Wrong origin IP in the Cloudflare DNS A/AAAA record (e.g. after a server migration).
- Firewall/security group dropping Cloudflare IP ranges.
- Server CPU/memory exhaustion or a full connection backlog.
- Keep-alive disabled on the origin, causing excessive new connections.
How to fix 522 Connection Timed Out
If you're visiting the site
- Wait a few minutes and try again; only the site owner can fix this.
If you run the site or API (developers)
- Verify the DNS record in Cloudflare points to the current origin IP.
- Allow Cloudflare IP ranges in every firewall layer (host, cloud security group, hosting panel).
- Check server load (
top,uptime) and connection backlog; scale up if saturated. - Enable HTTP keep-alive on the origin.
Returning or handling 522: server examples
Test connectivity
# From an outside machine: nc -vz -w 10 203.0.113.10 443 # Compare with the IP Cloudflare uses: dig +short example.com @1.1.1.1 # (proxied → Cloudflare IP; check DNS dashboard for origin)
nginx keep-alive
http {
keepalive_timeout 75s;
keepalive_requests 1000;
}Example 522 response
HTTP/2 522 server: cloudflare cf-ray: 8d2f1a3b4c5d6e7f-FRA content-type: text/html; charset=UTF-8
Related status codes
- 524 A Timeout OccurredCloudflare connected to the origin, but it didn't send an HTTP response within 100 seconds.
- 521 Web Server Is DownCloudflare couldn't connect to the origin because it refused the connection.
- 504 Gateway TimeoutA gateway or proxy didn't get a response from the upstream server in time.
Related tools
Frequently asked questions
How do I fix Cloudflare error 522?
Make sure the origin IP in Cloudflare DNS is correct, the server is up and not overloaded, and no firewall drops Cloudflare's IP ranges.
522 vs 524?
522 means the connection itself couldn't be established (or acknowledged). 524 means it connected but the HTTP response took longer than 100 seconds.
Is 522 caused by my internet?
No — it's between Cloudflare and the website's server.