Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Let's Encrypt renewal failing: redirect or firewall fix

OPS-070High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Let's Encrypt certificates last 90 days, so they must renew automatically. Most setups use the HTTP-01 challenge. The certificate authority requests a small file at http://yourdomain/.well-known/acme-challenge/<token> on port 80 and checks the content. If that request fails, the certificate is not renewed.

Common blockers of HTTP-01 validation
BlockerWhat happens
Forced HTTP to HTTPS redirect to a page or app routeThe challenge URL ends up at a 404, a login page or an app route instead of the token file
Firewall or security pluginPort 80 is closed, or requests from the validation servers are blocked
CDN or proxy ruleThe CDN answers port 80 itself, caches a 404, or forces its own redirect
Web server config changeA new virtual host or catch-all rule sends the challenge to the wrong folder
IPv6 record without a working listenerValidation tries IPv6 and finds nothing answering

Why it costs you leads or sales

When the certificate expires, browsers block the page with a warning. Visitors from ads, email and search leave, forms cannot be reached, and checkouts stop. Tracking and form posts may also fail. The break is silent until the expiry date, so it often lands on a weekend or in the middle of a campaign.

How a broken renewal unfolds (Example)
  1. Day 0

    A new redirect rule or firewall change is deployed. Nothing looks wrong.

  2. Day 60

    Certbot tries to renew and fails. The error sits in a log nobody reads.

  3. Day 75

    Another retry fails. The site still loads normally.

  4. Day 90

    The certificate expires. Visitors see a security warning and leave.

  5. Day 90 + hours

    You find the cause and fix the challenge path. A new certificate is issued.

Where renewal breaks
  1. Renewal startsCertbot or your host asks for a new certificate
  2. Challenge request on port 80Redirected, blocked or cached by a CDN
  3. Certificate renewedNever happens
  4. Visitors reach your siteBrowser warning after expiry
  5. Leads and salesForms and checkout unreachable

The validation request never reaches the token file, so the certificate expires and later visits fail.

How to check if your site has it

Find out whether renewal is blocked
  1. Run a dry runCustom code

    On the server, run sudo certbot renew --dry-run. It tests renewal against the Let's Encrypt staging service without changing your live certificate. Read the error: it names the URL and the status it got.

  2. Test the challenge path from outside

    Create a test file and request it over plain HTTP with curl -I http://yourdomain.com/.well-known/acme-challenge/test. You want a 200 or the file content, not a 301 to a page that does not serve it, a 403 or a 404.

  3. Follow the redirects

    Run curl -IL http://yourdomain.com/.well-known/acme-challenge/test. A redirect to HTTPS on the same host is allowed by Let's Encrypt. A redirect to another domain, a login page or a loop is not.

  4. Check port 80 is open

    Confirm port 80 is allowed in the server firewall, cloud security group and any hosting panel. Test from a different network than the server.

  5. Check the certificate expiry date

    Run echo | openssl s_client -servername yourdomain.com -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates and look at notAfter. If it is under 30 days and certbot has not renewed, renewal is failing.

  6. Read the logsCustom code

    Check /var/log/letsencrypt/letsencrypt.log for the failed authorization and the response the validation server saw.

Quick checks from a terminalbash
# Does the challenge path answer on port 80?
curl -IL http://yourdomain.com/.well-known/acme-challenge/test

# Test renewal without touching the live certificate
sudo certbot renew --dry-run

# When does the live certificate expire?
echo | openssl s_client -servername yourdomain.com -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates

How to fix it

The goal is that a request for /.well-known/acme-challenge/ on port 80 reaches the folder certbot writes to, with no login, block or rewrite in the way. If you cannot open port 80 at all, use DNS validation instead.

Fix by platform
  1. Exempt the challenge path from redirects (nginx)

    Add a location block for /.well-known/acme-challenge/ before the catch-all redirect on the port 80 server block, serving from your webroot. Then reload nginx.

  2. Exempt it in Apache

    Add a RewriteCond that skips ^/.well-known/acme-challenge/ before your HTTPS redirect rule, then reload Apache.

  3. Open port 80

    Allow inbound TCP 80 in ufw, firewalld, iptables and your cloud security group. Keep port 443 open too.

  4. Match certbot to your setup

    Check /etc/letsencrypt/renewal/yourdomain.com.conf uses the right authenticator and webroot path. If you cannot use port 80, switch to a DNS plugin for your DNS provider.

nginx: let validation through, redirect everything elsenginx
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt;
        try_files $uri =404;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}
Apache .htaccess: skip the redirect for validationhtaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

How to confirm it's fixed

Confirm renewal works
  • certbot renew --dry-run finishes with no errors
  • curl -IL http://yourdomain.com/.well-known/acme-challenge/test returns 200 for a test file, with no redirect to another host or a login page
  • Both the apex and www names pass, if both are on the certificate
  • The notAfter date moves forward after a real renewal
  • A scheduled renewal exists (systemctl list-timers or cron) and is active
  • The site loads over HTTPS in a private browser window with no warning
Renewal before and after the fix

Broken

  • Port 80 redirects the challenge path to a page that does not serve it
  • Dry run fails with a 404, 403 or timeout
  • Certificate counts down to expiry

Fixed

  • Challenge path is served on port 80 or DNS validation is used
  • Dry run passes
  • Certificate renews on schedule

How to prevent it happening again

Keep renewals healthy
  • Run certbot renew --dry-run after any change to redirects, firewall, CDN or server config
  • Keep the challenge path exception in your config, with a comment explaining why
  • Consider DNS validation if port 80 must stay closed
  • Send certbot failure emails to a monitored address
  • Set an expiry alert well before the 30-day renewal window ends
  • Note the renewal method in your runbook so a new team member does not remove it
Days left on the certificate when someone noticesExample numbers
Days left on the certificate when someone notices (example)Found by dry run after a change: 80 days; Found by expiry warning: 14 days; Found by visitors: 0 days0316180140Found by dry run afte…Found by expiry warni…Found by visitorsdays

Example: how much time you have to fix the problem depends on when you find it. Numbers are illustrative.

How FunnelGuard handles this

FunnelGuard detects this only partly. It checks the certificate your site presents and warns you when the expiry date is approaching. That warning covers a failed renewal in practice, because a renewal that keeps failing ends with a certificate running out of time.

What it does not do is test the renewal process itself. It does not run certbot, request the /.well-known/acme-challenge/ path to see if it is blocked, or tell you which redirect or firewall rule is at fault. So you learn about the problem when expiry gets close, not on the day the rule is changed.

Renewal fails, visitors see an error

The challenge request is blocked, the certificate expires and the page shows a security error.

Questions people ask

Why is my Let's Encrypt certificate not renewing?

The most common reason is that the validation request to /.well-known/acme-challenge/ on port 80 fails. A forced redirect, a closed port, a firewall rule or a CDN rule can stop it. Run certbot renew --dry-run to see the exact error.

Can a redirect from HTTP to HTTPS break Let's Encrypt renewal?

A simple redirect to HTTPS on the same host is fine. Renewal breaks when the redirect sends the challenge to another domain, a login page, an app route that returns 404, or a loop. Add an exception for the /.well-known/acme-challenge/ path before the redirect rule.

Does Let's Encrypt need port 80 open?

For the HTTP-01 challenge, yes. Validation requests arrive on port 80. If you cannot keep it open, use the DNS-01 challenge with a DNS plugin for your provider instead.

How do I test Let's Encrypt renewal without breaking my site?

Run sudo certbot renew --dry-run. It uses the Let's Encrypt staging service, so your live certificate is not changed. A clean result means the next real renewal should work with the same setup.

Can I allow-list Let's Encrypt IP addresses in my firewall?

It is not reliable. Let's Encrypt validates from several network locations and does not publish a fixed list of IPs. Allow the challenge path on port 80 instead, or switch to DNS validation.

Why does certbot work manually but fail on schedule?

The scheduled job may run as a different user, use an old webroot path, or run after a config change that added a redirect or block. Check the renewal file in /etc/letsencrypt/renewal/ and the timer or cron job, then run a dry run.

Will FunnelGuard tell me my Let's Encrypt renewal is broken?

Only partly. FunnelGuard warns when your certificate is close to expiry, which catches a renewal that keeps failing. It does not test the renewal process or the challenge path, so run a dry run yourself after changes.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: Expiry warning covers it.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.