Diagnosing Cloudflare HTTP 522 Connection Timed Out Errors
A diagnostic guide for Cloudflare 522 errors: direct origin tests, firewall checks, Cloudflare IP allowlists, and escalation criteria.
19 Mar 2026, 10:30 UTC

Recognizable condition
A visitor receives a Cloudflare-generated 522 "Connection Timed Out" page. The browser completed its connection to Cloudflare's edge, but Cloudflare could not complete a connection to your origin server within the timeout window. The practical takeaway is that the failure is almost always on the origin side, the network path to it, or a firewall between Cloudflare and the origin—not on Cloudflare's edge itself.
Cause and diagnostic table
| Cause | What you observe | First check |
|---|---|---|
| Origin server is down or unresponsive | Requests to the origin IP fail from any network | Send an HTTP request directly to the origin IP |
| Firewall or security group blocks Cloudflare IP ranges | Direct origin works from your network, but Cloudflare edge receives timeouts | Review firewall and cloud security group logs for dropped packets |
| Origin application is overloaded or deadlocked | Origin accepts connections but does not complete the HTTP request | Check origin process metrics and connection queues |
| Proxy-only path problem | 522 occurs with Cloudflare proxying enabled, but stops when DNS Only is set | Toggle the DNS record to DNS Only and retest |
Ordered checks
1. Reach the origin directly, bypassing Cloudflare
Run this from a host that can route to the origin IP, such as an administration host or bastion:
curl -v --resolve www.example.com:443:203.0.113.10 https://www.example.com/
Replace www.example.com with your origin hostname and 203.0.113.10 with the origin IP address. The --resolve flag forces the request to that IP while sending the correct Host header, which many origin applications require to select the right virtual host.
Required permissions: Network access to the origin IP. No Cloudflare access is needed for this step.
Expected check: A successful HTTP response, typically HTTP/1.1 200 or HTTP/2 200. If the command hangs and returns a connection timeout, the origin itself is unreachable or not answering on that port, and Cloudflare is not the root cause.
Risk: None. This is a read-only probe.
2. Correlate 522s in Cloudflare analytics
Open Cloudflare Network Analytics or Security Events for the domain and filter for HTTP 522 responses. Note the Ray IDs and timestamps for affected requests. A Ray ID is Cloudflare's unique identifier for a single request through its network. Compare the spike against recent origin deployments, firewall rule changes, traffic increases, or Cloudflare configuration edits.
Required permissions: Cloudflare dashboard access with Analytics or Logs permissions.
3. Confirm Cloudflare IP ranges are allowed
Check inbound rules at every layer between the internet and the origin:
- Host firewall, such as iptables, nftables, or Windows Firewall
- Cloud provider security group or network ACL
- Perimeter firewall or WAF in front of the origin
Cloudflare publishes its current IP ranges at https://www.cloudflare.com/ips/. Do not hardcode these addresses; they change, and hardcoded lists can break connectivity later. Add the current IPv4 and IPv6 ranges for ports 80 and 443, or the ports your origin uses.
Required permissions: Administrator access to the origin host or cloud console.
Risk: Editing firewall rules can accidentally block your own access. Test from a separate session before closing the current one.
4. Temporarily disable Cloudflare proxying
In the Cloudflare DNS dashboard, set the A or AAAA record for the affected hostname to DNS Only. This sends traffic directly to the origin, bypassing Cloudflare's edge proxy. Retest the failing URL.
- If 522s stop, the Cloudflare edge-to-origin path or proxy settings are implicated.
- If 522s continue, the origin or its network is the problem.
Required permissions: Cloudflare DNS edit permissions.
Risk: DNS Only removes Cloudflare DDoS mitigation, WAF, and caching for that record. Do not leave it disabled on production domains longer than necessary.
Fixes tied to findings
- Origin is down: Restart the origin service or scale capacity. Investigate application crashes, out-of-memory events, or database connection exhaustion.
- Cloudflare IPs are blocked: Add the current Cloudflare IP ranges to the host firewall, security group, and perimeter firewall allowlists. Use the published ranges file rather than static addresses.
- Origin is overloaded: Tune keepalive, connection timeouts, and worker or process limits. Add load balancers or additional origin capacity if traffic consistently exceeds current capacity.
- Proxy path is implicated: Review Cloudflare SSL/TLS settings. A mismatch usually causes redirect loops rather than 522s, but an origin that rejects Cloudflare's TLS handshake can produce connection timeouts. Confirm the origin certificate is valid for the hostname and that the origin accepts TLS 1.2 or 1.3.
Escalation criteria
Escalate to Cloudflare support only when all of the following are true:
- Direct access to the origin IP succeeds during the failure window.
- Cloudflare IP ranges are allowed at the host, security group, and perimeter layers.
- 522 responses continue with Cloudflare proxying enabled.
Provide the affected Ray IDs, timestamps, the origin IP, and MTR or traceroute results from the origin toward Cloudflare if your network team can collect them. Support cannot diagnose an origin-side timeout without this correlation data.
Limitations and verification
Do not confuse 522 with 524. A 522 means Cloudflare could not connect to the origin. A 524 means Cloudflare connected but the origin did not send an HTTP response in time. The fixes differ: 524 usually points to application slowness or long-running requests, while 522 points to connectivity or refusal.
Verify the fix by watching Cloudflare Network Analytics for new 522 Ray IDs after the change. If no new 522s appear during a normal traffic period, the fix likely resolved the issue.
Rollback
If you set a DNS record to DNS Only for troubleshooting, return it to Proxied after testing. This restores Cloudflare edge protection, caching, and WAF. Leaving DNS Only enabled on a production domain is not a supported long-term configuration.