5xx Cloudflare & Edge Error

HTTP 522 Connection Timed Out — Reverse Proxy & Gateway Troubleshooting

Error 522 Connection Timed Out means Cloudflare sent TCP SYN packets to your origin IP (taking ~15–19 seconds) or sent the HTTP request (taking ~90 seconds) and received zero acknowledgment before timing out.

Status Code522 Connection Timed Out
Specification / OriginCloudflare Edge Code 522
Failure LayerCloudflare Edge -> Origin Firewall / Routing
Retry SafetySafe for idempotent GET/HEAD with exponential backoff + jitter

Interactive HTTP 522 Live Probe & Log Command Builder

Enter your target endpoint below to generate copy-ready curl latency breakdown probes and origin bypass tests:


  

Related diagnostics: Nginx & Caddy Proxy Generator → · X.509 SSL Certificate Decoder → · Offline JWT Expiry Inspector →

Production Root Causes & Remediation Guide

Phase-1 (~19s) 522s almost always mean your cloud Security Group, UFW, or nftables DROP policy silently discards packets from Cloudflare's edge IPs, or DNS A records still point to a decommissioned server IP. Phase-2 (~90s) 522s indicate severe CPU/SYN-backlog exhaustion.

Step-by-Step Engineering Fix

Verify DNS A/AAAA records in the Cloudflare dashboard match your live server IP, allow TCP/443 from Cloudflare CIDRs in AWS/GCP Security Groups, and check Linux net.ipv4.tcp_max_syn_backlog under heavy load.

Recommended Nginx / Reverse-Proxy Configuration Snippet

# Check Linux SYN backlog drops and active socket queue
netstat -s | grep -i listen
ss -s

Frequently Asked Questions (HTTP 522)

How can timing how fast Cloudflare 522 appears diagnose the root cause?

If 522 appears after ~15–19 seconds, TCP SYN packets are being silently dropped by a firewall or wrong IP; if after ~90 seconds, TCP connected fine but the origin hung.

Which infrastructure layer generates HTTP 522 Connection Timed Out?

HTTP 522 (Cloudflare Edge Code 522) typically originates at the Cloudflare Edge -> Origin Firewall / Routing layer. Error 522 Connection Timed Out means Cloudflare sent TCP SYN packets to your origin IP (taking ~15–19 seconds) or sent the HTTP request (taking ~90 seconds) and received zero acknowledgment before timing out.

Should API clients automatically retry HTTP 522 responses?

HTTP 522 is safe to retry ONLY for idempotent methods (such as GET or HEAD) using exponential backoff with random jitter.

Browse All 25 Gateway, Proxy & Cloud HTTP Error Guides

HTTP 400 (Bad Request) HTTP 401 (Unauthorized) HTTP 403 (Forbidden) HTTP 404 (Not Found) HTTP 405 (Method Not Allowed) HTTP 408 (Request Timeout) HTTP 413 (Content Too Large) HTTP 422 (Unprocessable Content) HTTP 429 (Too Many Requests) HTTP 431 (Request Header Fields Too Large) HTTP 499 (Client Closed Request) HTTP 500 (Internal Server Error) HTTP 501 (Not Implemented) HTTP 502 (Bad Gateway) HTTP 503 (Service Unavailable) HTTP 504 (Gateway Timeout) HTTP 507 (Insufficient Storage) HTTP 511 (Network Authentication Required) HTTP 520 (Web Server Returned an Unknown Error) HTTP 521 (Web Server Is Down) HTTP 522 (Connection Timed Out) HTTP 523 (Origin Is Unreachable) HTTP 524 (A Timeout Occurred) HTTP 525 (SSL Handshake Failed) HTTP 526 (Invalid SSL Certificate)

Copied to clipboard