Fix Cloudflare 525 after a server update

Cloudflare 525 errors mean the connection between Cloudflare’s edge and your origin server failed during the TLS handshake. The visitor may see a warning, while the origin never receives a valid HTTPS request. A server software update can trigger this by changing certificate paths, TLS defaults, reverse-proxy configuration or the process listening on port 443.

Treat the error as a controlled incident rather than guessing from the error page. A 525 does not reveal the affected site’s owner, technology stack or whether data was compromised, and it does not justify turning off encryption. Document the change, reproduce the handshake, identify the broken setting and restore it with a tested rollback or corrected configuration.

Establish what actually changed

Begin with a timestamped incident record containing the affected hostname, exact time, observed status, recent package or image changes, and whether DNS records are proxied through Cloudflare. Preserve relevant proxy and system logs before a restart overwrites them, and record which hostname produced the 525. If several customer sites share an origin, test them separately because one broken listener can affect the entire group.

Map the blast radius before editing anything. Compare the apex and www names, then try the public hostname from a home NBN connection and a mobile network in Sydney or Melbourne; a DNS or routing problem can resemble a TLS fault. Australian businesses often manage .com.au or .au domains through local registrars, so ask whether recent DNS, DNSSEC or nameserver changes occurred. A successful DNS lookup still does not prove port 443 is healthy.

Confirm the Cloudflare edge behaviour

Use the Cloudflare dashboard to check whether the hostname uses a proxied DNS record and which SSL/TLS mode applies. A 525 commonly appears with Full or Full (strict) because Cloudflare expects a successful encrypted connection to the origin. Check the configured origin target, IPv4 and IPv6 addresses, and any origin rules or load-balancer health checks; an update may have moved the application without updating Cloudflare.

Compare the edge response with a direct origin request without changing the production hostname. A command such as curl -Iv https://www.example.com tests Cloudflare’s public certificate and network path, while curl -Iv --resolve www.example.com:443:ORIGIN_IP https://www.example.com/ preserves the hostname and tests the origin. Failure only on the second command points towards the origin, although access controls can also make that test fail.

Keep incident messages in one verified channel and remove stale administrative access during a prolonged outage. Teams that use Telegram for incident updates can review the Telegram inactivity timer setting so dormant accounts do not remain exposed while engineers restore service.

Test the origin handshake directly

Run a TLS handshake from a controlled machine and inspect the certificate chain with openssl s_client -connect ORIGIN_IP:443 -servername example.com -showcerts. Look for the presented leaf certificate, its issuer, protocol version, negotiated cipher and verification errors. On Linux hosts, confirm the listening service with ss -ltnp; no listener on 443, a crash loop after the update or a container that never started explains why no certificate is returned.

Interpret the output in layers. “Unable to get local issuer certificate” often indicates a missing intermediate, while “hostname mismatch” indicates the wrong certificate or virtual host. A protocol or cipher failure suggests incompatible TLS settings. If the handshake completes but the response is 502, the TLS fault has been cleared and attention should move to the proxy or application upstream. Repeated handshake failures can also reveal that the proxy is still loading an old configuration.

Reproduce the failure under the same conditions Cloudflare uses. Check the server clock, whether automated renewal wrote only part of the chain, and whether the proxy reads certificate files from the previous installation path. Test with the same SNI hostname, not just the IP address, because a default SSL virtual host can return a valid but irrelevant certificate.

Audit certificates and TLS settings

Audit the certificate and key as a matched pair before changing anything. Confirm that the certificate covers every public hostname, is currently valid, chains to an issuer trusted by Cloudflare under the selected mode, and matches the configured private key. Restoring an old .crt file without its matching key can produce another handshake failure, while an incomplete chain may work in a browser cache but fail at Cloudflare. Check the server clock as well.

Review the reverse-proxy settings affected by the update. Compare directives for ssl_certificate, ssl_certificate_key, ssl_protocols, ssl_ciphers, SNI hostnames and the default server; package upgrades sometimes rename paths or tighten supported protocols. Confirm that port 443 is bound to the intended service, that one process owns the socket, and that an application container is not competing with the proxy. Verify any required origin firewall or load-balancer source allowlist.

Treat logs and evidence as potentially sensitive data. For an Australian organisation covered by the Privacy Act 1988, IP addresses, account identifiers and request details may be personal information, so apply the Australian Privacy Principles when collecting, sharing and retaining troubleshooting material. Keep access limited to responders, remove unnecessary payloads and avoid pasting customer data into chat. If the outage may involve unauthorised access, follow the organisation’s incident process and assess notification duties with the privacy officer or the Office of the Australian Information Commissioner.

Restore the proxy and certificate chain

Choose the safest repair for the environment. If the update is recent and a known-good package, configuration or virtual-machine snapshot exists, a controlled rollback can restore service faster than inventing a fix under pressure. Keep Cloudflare in Full (strict), preserve the origin certificate and configuration files, and change one variable at a time. A staged host should receive the candidate version first so certificate loading and service startup can be tested without affecting production traffic.

Use only commands that match the installed software and operating system, and record every command with its output. A linked recovery resource may be useful as a secondary reference, but verify every step against the host and back up configuration first. Confirm private-key permissions, then reload the proxy gracefully instead of repeatedly restarting every application process.

Validate the repaired path through a staging hostname or temporary origin-only check before returning traffic to Cloudflare. Confirm that the leaf and intermediate certificates are presented correctly, the proxy has accepted the new configuration and the application receives the expected host header. Keep the previous certificate and package available until synthetic checks and real requests remain stable during normal traffic.

Verify recovery and compare causes

Watch both the Cloudflare status and origin logs during recovery. A return to an HTTP response proves more than a generic page load: the browser received an application response through the proxy. Use external checks from at least two Australian locations, including Brisbane or Perth as well as Sydney or Melbourne, and repeat them on a mobile network. Monitor 525, 502 and other 5xx rates separately so a partial fault is not hidden by an improving average.

The following comparison narrows the fault quickly:

Observed symptom Likely signal Next check
525 before any HTTP response TLS negotiation fails at Cloudflare Run openssl s_client against the origin
526 after a handshake Certificate validation fails Check the chain, names and expiry
502 after successful TLS Proxy cannot reach the application Inspect the upstream host and port
Connection refused Listener or firewall blocks port 443 Check ss and firewall rules
Different certificate by hostname SNI or default virtual host is wrong Check hostname mapping and server_name

Re-test with Full (strict) and confirm that Cloudflare sees the expected certificate without falling back to Flexible mode. If the origin permits only Cloudflare addresses, conduct the direct test from a controlled Cloudflare-access path or temporarily allow the required source while monitoring traffic. Restore the previous network policy as soon as the diagnosis is complete, and document the command, timestamp and result for the post-incident review.

Restore service and prevent recurrence

Prevent recurrence by making the update path observable. Use configuration management for reverse-proxy and certificate settings, run post-deployment synthetic TLS checks, and alert on repeated handshakes rather than only visitor-facing 5xx responses. Patch and backup procedures should identify rollback owners, certificate renewal paths and expected TLS versions. The ASD Essential Eight provides a useful Australian reference for patch management, backups and access control, while local managed-service providers can add round-the-clock monitoring for regional infrastructure.

Schedule the final change with Australian operating realities in mind: coordinate Sydney and Melbourne teams across AEST and AEDT, allow for regional holidays and avoid peak trading or support hours. If the site depends on an Australian registrar, confirm the DNS and certificate contact details before renewal. Record the change in plain language so a future responder can distinguish a rollback, certificate renewal and software deployment without relying on memory.

Open the incident record now, assign one engineer to the origin and another to Cloudflare, and begin with a timestamped handshake test. Preserve the evidence, repair the smallest confirmed fault and keep traffic encrypted while the fix is verified. Once the site responds consistently, publish the cause, customer impact and preventive actions to the people who depend on the service.