A Let's Encrypt certificate did not renew with Certbot
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:Short answer
Run sudo certbot renew --dry-run and read the Type and Detail lines. They say whether Let's Encrypt could not connect (port 80 or a firewall), fetched the wrong file (webroot or redirect) or reached the wrong server (DNS). If the dry run passes, the scheduled timer is not running or nginx was never reloaded after the last renewal.
Fix it fast
1Find out which cause you have
Run a test renewal. It talks to the Let's Encrypt staging server, so it does not use up production limits, and it prints the exact reason for each domain.
sudo certbot renew --dry-run2Match what you see, then jump to its fix
- 1
Type: connection, Timeout during connect (likely firewall problem)Port 80 is closed to the internetFix - 2
Type: unauthorized, Invalid response from .../.well-known/acme-challenge/...: 404, 403, or your app's HTMLThe challenge file is served from another folder, or a rule catches the pathFix - 3
Invalid response from an IP address that is not yours, or DNS problem: NXDOMAIN looking up A for example.comDNS sends the name to another serverFix - 4
Could not bind TCP port 80 because it is already in use by another process on this systemThe certificate was issued with --standalone, and nginx now holds port 80Fix - 5
No recent entries in /var/log/letsencrypt/letsencrypt.log, or certbot certificates shows a new expiry date while browsers still see the old oneRenewal never runs, or nginx keeps serving the old certificateFix - 6
The error type is rateLimited and the message names a time to retry afterRepeated failed attempts hit a rate limitFix
- 1
What does the error look like?
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:Type: connection ... Timeout during connect (likely firewall problem)Type: unauthorized ... Invalid response from http://example.com/.well-known/acme-challenge/...: 404Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server).All renewals failed. The following certificates could not be renewed:
Cause 1 of 6
Port 80 is closed to the internet
1Check
HTTP-01 validation always arrives on port 80, even for a site that runs only on HTTPS. Check the server's firewall and the cloud provider's firewall or security group, then request a challenge URL from a machine outside your network.
sudo ufw status | grep -E '^80|Nginx'
curl -sI -m 10 http://example.com/.well-known/acme-challenge/test2Fix
Open port 80 and leave it open. Normal visitors can still be redirected to HTTPS; only the challenge path has to answer over plain HTTP or redirect to HTTPS on port 443.
sudo ufw allow 80/tcp3Verify
From outside, the test URL now returns an HTTP status line (a 404 is fine) instead of hanging.
curl -sI -m 10 http://example.com/.well-known/acme-challenge/test | head -n 1Cause 2 of 6
The challenge file is served from another folder, or a rule catches the path
1Check
With the webroot plugin, Certbot writes the challenge file under the folder saved in the certificate's renewal file. If the site moved, or the port 80 server block hands every path to the app or puts it behind a password, Let's Encrypt fetches the wrong answer. Compare the saved folder with what nginx serves.
sudo grep -E 'authenticator|webroot' /etc/letsencrypt/renewal/example.com.conf
sudo nginx -T 2>/dev/null | grep -n -A3 'acme-challenge\|listen 80'2Fix
Give the challenge path its own fixed folder in the port 80 server block, ahead of the HTTPS redirect, then save that folder in the renewal settings with certbot reconfigure (Certbot 2.3 and later). Reconfigure runs a test renewal before it saves anything.
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
location ^~ /.well-known/acme-challenge/ {
root /var/www/letsencrypt;
default_type text/plain;
}
location / {
return 301 https://$host$request_uri;
}
}
sudo mkdir -p /var/www/letsencrypt/.well-known/acme-challenge
sudo nginx -t && sudo systemctl reload nginx
sudo certbot reconfigure --cert-name example.com --webroot --webroot-path /var/www/letsencrypt3Verify
Drop a test file in the folder and fetch it over plain HTTP.
echo ok | sudo tee /var/www/letsencrypt/.well-known/acme-challenge/ping
curl -s http://example.com/.well-known/acme-challenge/pingCause 3 of 6
DNS sends the name to another server
1Check
When a name has both A and AAAA records, Let's Encrypt connects over IPv6 first and falls back to IPv4 only if that connection times out. An AAAA record left over from an old server, or a CDN proxy that was switched on, sends validation somewhere else. Compare every record with this server's own addresses.
dig +short A example.com
dig +short AAAA example.com
ip -br addr show scope global2Fix
Correct or delete the wrong record at your DNS provider. If nginx should answer on IPv6, make it listen there; if the server has no IPv6, remove the AAAA record rather than leave it pointing at nothing.
# nginx, in the port 80 server block
listen [::]:80;
# after the DNS change, ask a public resolver
dig +short AAAA example.com @1.1.1.13Verify
Once the old record's TTL has passed, run the test renewal for this certificate only.
sudo certbot renew --dry-run --cert-name example.comCause 4 of 6
The certificate was issued with --standalone, and nginx now holds port 80
1Check
The standalone plugin starts its own short-lived web server on port 80. That worked at first issue, before nginx was installed; every renewal since then collides with nginx. The renewal file shows which plugin was saved.
sudo grep -H authenticator /etc/letsencrypt/renewal/*.conf2Fix
Switch the saved method to one that works next to nginx: the nginx plugin, which also reloads nginx after each renewal, or webroot with the location block from the cause above.
sudo certbot reconfigure --cert-name example.com --authenticator nginx --installer nginx3Verify
The renewal file now names nginx, and a test renewal passes while nginx keeps running.
sudo grep -E 'authenticator|installer' /etc/letsencrypt/renewal/example.com.conf
sudo certbot renew --dry-run --cert-name example.comCause 5 of 6
Renewal never runs, or nginx keeps serving the old certificate
1Check
Certbot from apt is scheduled by certbot.timer and the snap by snap.certbot.renew.timer. If neither is listed, nothing renews. If renewal did run, compare the expiry on disk with the one nginx serves: nginx only loads a new certificate on reload.
systemctl list-timers | grep -i certbot
sudo certbot certificates | grep -E 'Certificate Name|Expiry'
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate2Fix
Enable the timer, and add a deploy hook so nginx reloads whenever a certificate actually changes. Executables in the deploy hooks folder run only after a successful renewal.
sudo systemctl enable --now certbot.timer # snap: snap.certbot.renew.timer
sudo tee /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh >/dev/null <<'EOF'
#!/bin/sh
systemctl reload nginx
EOF
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh3Verify
The timer has a next run time, and after the next renewal the served expiry date matches the file on disk.
systemctl status certbot.timer --no-pagerCause 6 of 6
Repeated failed attempts hit a rate limit
1Check
Let's Encrypt allows 5 failed validations per domain per account per hour, and 5 certificates for the exact same set of names every 7 days. A cron line that forces renewal, or a script that retries in a loop, reaches these quickly. Renewals scheduled through ACME Renewal Information (ARI, supported since Certbot 4.1) are exempt from every limit.
sudo grep -i "ratelimited" /var/log/letsencrypt/letsencrypt.log | tail -n 3
sudo grep -R "force-renew" /etc/cron* /etc/systemd/system 2>/dev/null2Fix
Stop retrying against production. Remove any forced renewal from cron, fix the cause with --dry-run (staging has separate limits), wait until the retry time in the error, then run one real renewal.
sudo certbot renew --dry-run --cert-name example.com
# after the retry time has passed:
sudo certbot renew --cert-name example.com3Verify
The certificate shows a new expiry date about the full lifetime ahead.
sudo certbot certificates --cert-name example.comHow do I stop it coming back?
- Monitor expiry from outside the server: Let's Encrypt stopped sending expiry emails on 4 June 2025, so nothing warns you unless you set it up.
- Keep port 80 open with a fixed challenge location in every site, including those that send everything else to HTTPS.
- Run sudo certbot renew --dry-run after any change to DNS, the firewall or nginx.
- Keep Certbot current and let it decide when to renew. Let's Encrypt moves its default certificates to 64 days on 10 February 2027 and 45 days on 16 February 2028, so a fixed hand-made schedule will break.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
curl cannot connect to port 80 or 443 on a server running nginx
CURLE_COULDNT_CONNECT (7): Failed to connect() to host or proxy
Exit code 7 means the TCP connection itself failed, before any HTTP happened.
3 causes, each with a fixServers
Django returns a 500 behind Gunicorn and the traceback is nowhere
The traceback shows locally with runserver but not under Gunicorn
With DEBUG set to False, Django's default logging does not print errors to the console.
2 causes, each with a fixServers
Your website on a Google Compute Engine VM times out on port 80
The site works with curl on the VM but not from outside
A timeout, as opposed to a refusal, usually means a firewall dropped the packets.
3 causes, each with a fixServers
Gunicorn rejects a request with "Error parsing headers: limit request headers fields size"
Error parsing headers: 'limit request headers fields'
Gunicorn caps the size of one header field at 8190 bytes and the number of headers at 100 by default.
2 causes, each with a fixServers
HAProxy answers 503 "No server is available to handle this request"
No server is available to handle this request.
HAProxy sends 503 when it has no server to give a request to.
4 causes, each with a fixServers
A Next.js static export works by clicking links but gives 404 on refresh or deep links
The home page loads, but a direct link to /blog/post-1 returns 404
A static export writes one HTML file per route, such as about.html.
3 causes, each with a fix