What to Check When Cloudflare Returns a 5xx Error for Your Website
What should a small business check when Cloudflare returns a 5xx error for its website?
Record the displayed error code, affected URL, observed time and page details. Use Cloudflare error analytics where available to collect details such as URLs, source IP addresses and Cloudflare data centres. Check the origin server and any load balancer, cache, proxy or firewall between Cloudflare and the origin. Treat firewall blocking and a struggling origin as hypotheses rather than conclusions, and keep 521, 522 and 520 incidents separate because the displayed codes describe different conditions.
- Cloudflare says Custom Errors can alter the appearance of the default error pages discussed in its 5xx guidance.
- Cloudflare 5xx errors · Cloudflare Support docs · As of 2026-11-23
- Cloudflare says error analytics can show overall errors by HTTP error code and details including URLs, source IP addresses and Cloudflare data centres for diagnosis.
- Cloudflare 5xx errors · Cloudflare Support docs · As of 2026-11-23
- Host-Tracker describes error 522 as receiving no answer within Cloudflare’s timeout window and error 520 as a successful connection followed by a broken HTTP response.
- Cloudflare Error 521: web server is down - causes and fixes · As of 2026-11-23
- Cloudflare advises checking logs for any load balancers, caches, proxies or firewalls between Cloudflare and the origin web server.
- Cloudflare 5xx errors · Cloudflare Support docs · As of 2026-11-23
Confirm what the error page actually tells you
Cloudflare says Custom Errors can alter the appearance of the default error pages discussed in its 5xx guidance. Record the visible code, affected URL and any identifying detail rather than deciding what happened from the page’s branding or layout.
Sources: Cloudflare 5xx errors · Cloudflare Support docs.
Take a screenshot if practical, note the observed time and preserve the exact page wording for the person who will investigate the incident.
- Copy the displayed error code.
- Record the affected URL and observed time.
- Do not rely on page styling alone.
Record the error before changing anything
Cloudflare says error analytics can show overall errors by HTTP error code and details including URLs, source IP addresses and Cloudflare data centres for diagnosis. Create a separate incident entry for each affected URL and occurrence, recording only details you can observe or retrieve.
Sources: Cloudflare 5xx errors · Cloudflare Support docs.
Use the same discipline as a controlled enquiry test: record what happened, what was tested and what the result does not establish.
- Record the code, URL and observed time.
- Check available error analytics.
- Keep observations separate from suspected causes.
Use the error type to narrow the investigation
Host-Tracker describes error 522 as receiving no answer within Cloudflare’s timeout window and error 520 as a successful connection followed by a broken HTTP response. Use the displayed Cloudflare 5xx code to choose what to inspect first, while recognising that the code alone does not prove the underlying cause.
Sources: Cloudflare Error 521: web server is down - causes and fixes.
Review the Cloudflare-to-origin encryption boundary when the available evidence points to that connection, rather than changing encryption settings speculatively.
- Keep 521, 522 and 520 incidents separate.
- 522 is described as no answer within the timeout window.
- 520 is described as a broken HTTP response after connection.
Inspect every logged handoff to the origin
Cloudflare advises checking logs for any load balancers, caches, proxies or firewalls between Cloudflare and the origin web server. Work along the delivery path and mark each log source as checked, unavailable or requiring access from another provider.
Sources: Cloudflare 5xx errors · Cloudflare Support docs.
Use a nameserver change recovery process if the failure began after a delegation change and the website or email service also needs checking.
- Check origin-server records.
- Check load balancer, cache, proxy and firewall records.
- Match records to the affected URL and occurrence.
Test firewall and origin-load explanations carefully
A Google Search Central Community member suggested that origin firewalls could block Cloudflare nodes and that an origin may be overloaded or struggling to serve requests. Treat those possibilities as starting points for review, not as an authoritative diagnosis or proof that either condition applies to your website.
Use an origin readiness checklist if the investigation also raises questions about secure origin connectivity.
- Treat firewall blocking as a hypothesis.
- Treat origin strain as a hypothesis.
- Confirm either explanation from records.
Account for repeated origin fetches through distributed caches
A Google Search Central Community member stated that separate cache nodes can fetch pages or files from the origin multiple times. Consider that possibility when reviewing origin demand, but do not infer the amount or cause of demand without your own records.
Review Cloudflare caching controls only after the immediate incident is stable, with deliberate choices for routes such as logins, forms and ecommerce.
- Caching does not mean every request avoids the origin.
- Review demand alongside cache behaviour.
- Stabilise the incident before changing cache rules.
Cloudflare 5xx diagnostic workflow
Use this workflow to preserve evidence before making changes. It helps organise a technical handoff; it does not identify a cause by itself.
| Stage | What to record or check | What it helps you decide |
|---|---|---|
| 1. Capture | Displayed code, affected URL, observed time and page details | Whether the same occurrence can be matched elsewhere |
| 2. Add context | Available analytics details, including URL, source IP address and data centre | Which diagnostic records may relate to the occurrence |
| 3. Classify | Whether the displayed code is 521, 522, 520 or another 5xx code | Which reported condition needs closer review |
| 4. Trace | Origin, load balancer, cache, proxy and firewall log status | Where evidence is present, absent or needs provider access |
| 5. Test | Firewall and origin-load hypotheses against the collected records | What a technical contact should investigate next |
Keep observed facts separate from suspected explanations. Confirm a provider’s current requirements in its own documentation before making a service-affecting change.
When this is not the right approach: Use emergency support or your hosting provider’s incident channel instead when you cannot access the systems involved or the outage requires an immediate provider-side response.
Related guidance
Another perspective
A Cloudflare-branded 5xx page is not, by itself, proof that Cloudflare caused the failure. Preserve the displayed evidence and trace the request path before changing settings.
What follow-up questions matter most?
- What should I do first when Cloudflare shows a 5xx error?
- Record the displayed error code, affected URL, observed time and any identifying details. Where available, use Cloudflare error analytics for diagnostic context, then compare the event with origin and intermediary logs before changing configuration.
- Can I identify a Cloudflare error from the page design alone?
- No. Cloudflare says Custom Errors can change the appearance of its default error pages. Record the code and other displayed details rather than relying on colours, branding or layout.
- Are Cloudflare errors 521, 522 and 520 the same?
- No. Host-Tracker describes 522 as receiving no answer within Cloudflare's timeout window and 520 as a connection that succeeds before a broken HTTP response follows. Keep the displayed codes separate when investigating them.
- Does a 5xx error prove that my firewall or server is at fault?
- No. Firewall blocking and a struggling origin are possibilities raised by a community member, not proven causes. Review the relevant firewall, origin and intermediary records before making a corrective change.
What steps does this workflow follow?
Cloudflare 5xx first-response workflow
- Capture the displayed failure: Record the error code, affected URL, observed time and any identifying details shown on the page before refreshing repeatedly or changing settings.
- Check available analytics: Use Cloudflare error analytics where available to collect details that can help match the event to other records.
- Separate related error types: Keep the displayed error code distinct from nearby codes so different connection behaviours are not merged into one diagnosis.
- Trace the delivery path: Review the origin server and every relevant load balancer, cache, proxy and firewall between Cloudflare and the origin.
- Test explanations with records: Treat firewall blocking and a struggling origin as hypotheses, then use the collected records to decide what needs technical review.