HTTP 522 Connection Timed Out (Cloudflare)
Scrapeless Web Unlocker retrieves public page content for workflows that need to distinguish origin-connection failures from usable results.
HTTP 522 Connection Timed Out is a Cloudflare error reporting a timeout while contacting the origin web server. Your browser may have reached Cloudflare successfully even though Cloudflare could not complete the required connection exchange with the server behind it. The repair therefore usually belongs to the website operator or hosting provider.
TL;DR
- A 522 concerns communication between Cloudflare and the origin. It is not evidence that a browser selector took too long.
- Connection establishment and request acknowledgment are different phases. Identify which exchange failed before tuning application timeouts.
- An incorrect origin address or a firewall rule can cause 522. Origin capacity and packet delivery also deserve investigation.
- A collector must preserve the failure boundary. A complete error document is not the requested page content.
Where a 522 Happens in the Request Path
A 522 happens on the Cloudflare-to-origin portion of a request path. The visitor first communicates with Cloudflare; Cloudflare then needs to communicate with the origin that serves the site. A failure on the second portion can produce an error page that reaches the visitor normally. Receiving that page proves the visitor received an HTTP response, but does not prove the origin handled the requested operation.
The Cloudflare 522 definition identifies two relevant cases: a timeout before the TCP connection is established and a missing acknowledgment after connection establishment. These are transport-level observations. Do not translate the second case into a claim that the application merely took too long to generate its full response; acknowledgment and application completion are different events.
An application access log may contain no matching entry if the request never reached the application layer. That absence is useful only alongside the other evidence. It could indicate a connection failure, a logging gap, or a request delivered to a different origin. Check the destination and logging coverage before deciding which explanation applies.
How 522 Differs From Nearby Errors
HTTP status and local exceptions describe different boundaries. The HTTP semantics standard defines general gateway and server statuses, while 522 is a Cloudflare-specific diagnostic code. Keeping that distinction in your incident record helps route the issue to the correct owner.
| Result | Boundary to Investigate | Evidence to Collect |
|---|---|---|
| Cloudflare 522 | Cloudflare communication with the origin | Origin address, firewall events, connection logs |
| HTTP 504 | A gateway waiting for its upstream | Gateway timing and upstream request trace |
| HTTP 503 | A service unable to handle the request | Capacity, maintenance state, healthy backend count |
| Client connection timeout | The client's connection path | Resolver, proxy, destination, and connection phase |
| Browser element timeout | The expected page state | Final document, locator, screenshot, and page errors |
A single incident can generate more than one symptom. A collection client with a short deadline might stop waiting before Cloudflare returns a 522. Another client with a longer deadline might receive the error document. Those observations can describe the same underlying outage without being the same error category.
Check the Origin Address Before Changing Capacity
The configured origin address must match the server that is currently provisioned to handle the website. Compare Cloudflare's DNS configuration with the hosting provider's current address and the expected environment. A recent migration, instance replacement, or DNS edit can leave traffic directed at an old destination.
Verify the hostname and port that the origin expects. A server being online is not enough if the required listener is absent or the intended virtual host is not served. When conducting an authorized direct-origin check, preserve the correct hostname and TLS expectations; an IP-only test can exercise a different virtual host and produce misleading evidence.
Keep the scope narrow. If one hostname fails while another works, compare their origin mappings and routing configuration rather than assuming the entire hosting platform is unavailable. If several unrelated sites on the same origin fail together, shared network or resource evidence becomes more relevant.
Inspect Firewalls and Hosting Network Controls
Firewall inspection should establish whether Cloudflare's connections reach the origin and receive the expected replies. Review host firewalls, security groups, hosting filters, and any automated blocking system in the path. A control at an outer network layer can drop traffic before the operating system records an application request.
Where the architecture requires Cloudflare-to-origin access, verify that the current Cloudflare address ranges are handled by the intended policy. Do not replace a specific policy with unrestricted public access as a diagnostic shortcut. Ask the hosting provider to identify the source, destination, action, and timestamp of relevant drops.
Compare configuration history with the first failing interval. A rule update that coincides with the outage is a lead, not proof. Look for matching traffic in logs or packet evidence, then test the smallest justified correction. Document the reason for the rule so a later cleanup does not reintroduce the restriction.
Investigate an Origin That Is Running but Unresponsive
A running origin can still fail to accept or acknowledge connections promptly when its resources or network path are constrained. Examine connection counts, listener health, CPU pressure, memory pressure, and the hosting provider's network observations. Check whether the failure affects new connections, existing connections, or only a subset of paths.
Application metrics alone may miss the problem. A dashboard showing low request throughput can mean the application has spare capacity, or it can mean requests are not reaching it. Pair application telemetry with transport and host metrics so low throughput is not mistaken for healthy service.
Keep-alive configuration is another origin-side detail worth checking against the deployment's requirements. Avoid changing several transport settings at once. A narrowly tested change produces interpretable evidence, while simultaneous changes to DNS, firewall rules, and server capacity make it difficult to know what repaired the connection path.
Use a Timeline to Connect Browser and Origin Evidence
A timeline should show when the visitor began the navigation, when Cloudflare returned the error, and what the origin observed during that interval. Browser timing and server timing describe different perspectives. The Navigation Timing model helps distinguish navigation phases, but browser-side timings alone cannot reveal every exchange between Cloudflare and the origin.
Record timezones with timestamps in the incident system. Correlate the error page's request identifier when available with the relevant hostname and origin logs. If clocks are not aligned, say so explicitly rather than claiming a precise match between events that happened on different machines.
Compare a failing interval with a known successful interval under the same routing configuration. Note changes in destination, connection success, and host health. An isolated successful page load does not prove the origin remained healthy for the full affected period, especially when several origins or geographic paths are involved.
What Visitors and Data Collectors Should Preserve
Visitors should preserve enough evidence for the site operator to investigate the origin path. Include the affected address, the error number, the approximate time, and the request identifier shown on the page. Report whether the problem affects the whole site or a particular action, without exposing private query parameters or authentication details.
Data collectors should keep a 522 result outside the target dataset. If the task was to collect a product price, a valid-looking HTML document with Cloudflare branding does not satisfy the task. Store a classified failure and keep any older price with its original collection time. This preserves the difference between missing current data and a real unchanged price.
The Cloudflare content-validation workflow is relevant to this acceptance boundary. Check the page identity and required fields after transport completes. Error handling at collection time is only useful if downstream consumers can distinguish a missing observation from an accepted record.
Web Unlocker Does Not Repair the Origin Server
Web Unlocker can provide managed content retrieval for public-page workflows, but it cannot correct a website's DNS mapping, reopen its firewall, or restore its origin capacity. Those controls belong to the operator. Its role in a 522 investigation is limited to the retrieval path and the evidence available from that request.
Review the Web Unlocker introduction before deciding whether rendered retrieval fits the collection task, and use current Scrapeless pricing for workload planning. Keep service-level results separate from target-site results whenever the response contract distinguishes them. A completed API exchange does not automatically establish successful target-page collection.
Define a stop condition for collection when the source is unavailable. Continuing to admit more work against an impaired origin can waste resources and obscure the first useful evidence. Resume normal collection only under your operational policy after the responsible owner has established that the source can serve the intended traffic.
Conclusion
HTTP 522 investigation starts with the origin connection path. Confirm the destination, inspect network controls, and correlate transport evidence with host health. Visitors and collectors should supply a concise incident record and preserve unavailable observations accurately; the site operator and hosting provider must repair the underlying origin communication.
Keep Origin Failures Out of Your Dataset
Use Web Unlocker for eligible public-page retrieval and retain a clear acceptance check between returned content and validated records.
Sign up today and get $5 in free credit — no credit card required.
Claim Your $5 Credit →FAQ
Q: Can clearing browser cookies fix a 522?
Clearing browser cookies does not repair the Cloudflare-to-origin connection path. Cookies may affect other application behavior, but a 522 investigation should focus on the configured origin, network controls, and origin health.
Q: Is 522 the same as a slow database query?
A 522 does not by itself diagnose a slow database query. Its definition concerns Cloudflare contacting the origin at the connection and acknowledgment boundary. A database problem requires application or database evidence, even if resource pressure connects the incidents.
Q: Who should receive a 522 incident report?
The website operator or hosting provider should receive the initial report because they control the origin path. Include the hostname, time, error identifier, and scope. They can involve Cloudflare with the relevant network and configuration evidence.
Q: Why does the homepage work while another URL fails?
A working homepage does not prove every request uses the same path or origin work. Cached content, routing differences, and path-specific behavior can produce different observations. Compare request evidence before assuming the contrast identifies the exact cause.
Q: Will a larger client timeout remove 522?
A larger client timeout does not change Cloudflare or origin connection behavior. It may only allow the client to receive an error it previously stopped waiting for. Change a deadline only after identifying the operation it actually supervises.