Let’s Encrypt with Cloudflare: Full (Strict) TLS, Origin Certificates, and Safe Renewal
Let’s EncryptCloudflareOrigin TLSFull Strict SSLHTTPSCertificate troubleshooting

Let’s Encrypt with Cloudflare: Full (Strict) TLS, Origin Certificates, and Safe Renewal

LLet’s Encrypt Editorial Team
2026-11-10
7 min read

Configure Let’s Encrypt behind Cloudflare with Full (strict) TLS, reliable renewal, and practical fixes for 525 and 526 errors.

Running Let’s Encrypt behind Cloudflare is straightforward when each TLS connection is configured deliberately. This guide explains edge versus origin certificates, compares Full and Full (strict) encryption, shows what to install on the origin server, and provides monitoring, troubleshooting, and rollback steps for reliable HTTPS.

Overview

When a domain uses Cloudflare’s proxy, visitors normally establish an HTTPS connection with Cloudflare first. Cloudflare then creates a second connection from its edge network to your origin server. These are separate TLS connections and can use different certificates.

The certificate presented to visitors is the edge certificate. Cloudflare manages this certificate for proxied hostnames according to the zone’s configuration. The certificate installed on your web server is the origin certificate. It protects the connection between Cloudflare and your server.

A Let’s Encrypt certificate can serve as the origin certificate. It is publicly trusted, covers the requested hostname, and can also be used when the server is accessed directly while you test or temporarily disable the proxy. Cloudflare also provides origin-specific certificates for proxied traffic. An Origin CA certificate is intended for Cloudflare-to-origin connections, so it should not be treated as a general-purpose public certificate for direct browser access.

For most production sites, the preferred design is HTTPS from the visitor to Cloudflare and HTTPS again from Cloudflare to the origin, with Full (strict) selected for the origin connection. The exact names or location of dashboard controls can change, so verify the current Cloudflare interface before applying a configuration.

Cloudflare modeVisitor to CloudflareCloudflare to originPractical guidance
OffHTTPHTTPNot appropriate for a site that needs HTTPS.
FlexibleHTTPSHTTPLeaves the origin leg unencrypted and can create redirect loops.
FullHTTPSHTTPS, with relaxed certificate validationUseful during migration, but it does not provide strict origin identity validation.
Full (strict)HTTPSHTTPS, with certificate and hostname validationRecommended when the origin has a suitable Let’s Encrypt or compatible origin certificate.

What to track

1. The two certificate paths

Check both sides independently. From a browser, inspect the certificate presented for the public hostname and confirm that the address uses HTTPS. Separately, check the certificate installed on the origin. It should be unexpired, include the hostname Cloudflare uses to connect, and be served with the correct intermediate chain where required.

With Certbot, the web server commonly needs the certificate chain file rather than only the leaf certificate. For Nginx or Apache, review the certificate and private-key paths in the active virtual host. The private key must remain readable by the web server but inaccessible to unprivileged users.

For a detailed explanation of cert.pem, chain.pem, fullchain.pem, and privkey.pem, see Let’s Encrypt Certificate Files Explained.

2. Renewal and reload behavior

Record the certificate expiry date, the ACME validation method, the renewal command or timer, and the service reload command. A successful renewal is not enough if Nginx, Apache, or another proxy continues serving the old certificate. Run a renewal test in a safe environment, confirm that the deployment hook reloads the service, and retain logs that show the result.

HTTP-01 validation can work with Cloudflare proxying when the challenge request reaches the correct origin. DNS-01 is often more suitable for wildcard certificates or deployments where HTTP routing is difficult, but it requires controlled DNS automation. Avoid leaving long-lived DNS API credentials on an exposed server.

3. DNS and proxy status

Track whether each relevant DNS record is proxied or DNS-only. The proxy status determines whether Cloudflare sits between the client and origin. A direct test against the origin may require a temporary DNS-only record, an internal hostname, or a command that sends the expected Host header to the origin address. Document the method so a future operator does not mistake a direct-origin result for a Cloudflare result.

4. Error signals

Monitor recurring 525 and 526 responses, origin connection failures, certificate expiry warnings, and renewal job failures. A 525 generally indicates that Cloudflare could not complete the TLS handshake with the origin. A 526 generally indicates that Cloudflare could connect but rejected the origin certificate under strict validation. These errors point to different investigation paths and should not be treated as interchangeable.

Cadence and checkpoints

Use a short checklist after every deployment, certificate rotation, DNS change, server rebuild, or change to the Cloudflare proxy status:

  • Confirm the public hostname resolves to the intended Cloudflare-managed records.
  • Confirm the edge certificate covers every hostname users will visit.
  • Confirm the origin certificate covers the hostname Cloudflare sends to the server.
  • Verify that the origin serves the complete certificate chain and the matching private key.
  • Set the encryption mode to Full (strict) after the origin certificate is ready.
  • Test the homepage, login, forms, APIs, assets, and redirects over HTTPS.
  • Confirm that renewal completes and that the web server reloads successfully.

On a monthly or quarterly cadence, review certificate expiry, renewal logs, DNS records, proxy status, TLS errors, and monitoring coverage. The interval should be shorter if the site has frequent releases, multiple origin servers, manually rotated certificates, or business-critical traffic.

Before a planned migration, lower DNS TTL only where it helps the specific move, prepare the new origin certificate in advance, and test the new server before changing traffic. The Website Migration Checklist provides a broader sequence for moving a domain and hosting service.

How to interpret changes

When Full (strict) produces a 526

Check the certificate at the origin, not only the certificate visible in a browser. Confirm that it is still valid, matches the requested hostname, is issued by a CA Cloudflare accepts for strict validation, and is paired with the correct private key. Also check the server clock, the active virtual host, and whether a load balancer is sending some requests to an unconfigured origin.

Do not use Full as a permanent substitute for fixing an invalid certificate. It can help isolate a migration problem, but it relaxes certificate identity checks. Return to Full (strict) after installing a valid origin certificate.

When Cloudflare reports a 525

Investigate the TLS handshake itself. Confirm that the origin listens on the expected HTTPS port, accepts connections from Cloudflare, supports a compatible TLS configuration, and presents a certificate during the handshake. Review firewall rules, security groups, SNI handling, and web-server error logs. If the origin is overloaded or intermittently reachable, the error may be a connectivity or capacity problem rather than a certificate problem.

When redirects loop

Redirect loops commonly occur when the origin redirects HTTP to HTTPS while Cloudflare uses an HTTP origin connection. Use end-to-end encryption with Full (strict), configure the application to understand the forwarded HTTPS state where necessary, and ensure only one component owns the canonical HTTP-to-HTTPS redirect. Test both the apex domain and the www hostname if both are published.

After HTTPS works consistently, consider security headers such as HSTS carefully. HSTS changes browser behavior and can make future certificate or hostname mistakes harder to recover from. Roll it out deliberately rather than enabling it as a quick fix; see the Website HTTPS Security Headers Guide.

When to revisit

Revisit this configuration monthly or quarterly, and immediately after any event that changes the traffic path. The most important triggers are a new hosting provider, a rebuilt server, a changed origin IP, a switch between proxied and DNS-only records, a new hostname, a certificate renewal failure, or a Cloudflare dashboard or TLS-behavior change.

Keep a simple deployment record containing the encryption mode, origin hostname, certificate location, renewal mechanism, DNS validation details, and rollback owner. Before changing production settings, test with a staging certificate or non-production hostname where possible. The guide to Let’s Encrypt staging certificates can help prevent accidental ACME rate-limit issues during testing.

If a change causes an outage, use this rollback sequence: preserve logs; restore the last known-good origin configuration; return the Cloudflare mode to the previously working setting only long enough to recover service; verify DNS and proxy status; then retest the origin certificate and return to Full (strict) as soon as the underlying issue is corrected. Record what changed and update the checklist so the next certificate rotation or server move is safer.

Related Topics

#Let’s Encrypt#Cloudflare#Origin TLS#Full Strict SSL#HTTPS#Certificate troubleshooting
L

Let’s Encrypt Editorial Team

Technical Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.