About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Certbot ends with Some challenges have failed. and a block that reads Type: unauthorized and Detail: ... Invalid response from http://www.example.com/.well-known/acme-challenge/...: 404. It means Let's Encrypt did reach a web server for that name, asked for the challenge file, and got a status other than 200. The server that answered is either not your server, or your server has no rule that serves /.well-known/acme-challenge/ from the folder Certbot writes to. The address in the Detail line tells you which server answered.
What the error means
Certbot builds the failure report from what the certificate authority returns. In the Certbot 5.10.0 source the report starts Certbot failed to authenticate some domains (authenticator: ...). The Certificate Authority reported these problems:, lists Identifier, Type and Detail for each failed name, adds a hint for the authenticator, and then the command stops with Some challenges have failed. Earlier versions, such as 3.0.1, print Domain: where 5.10.0 prints Identifier:.
unauthorized is an ACME error type. RFC 8555 describes it as "The client lacks sufficient authorization". The Detail text comes from Let's Encrypt. In its Boulder source at tag v0.20261201.0, a final status other than 200 produces Invalid response from %s: %d, with the URL and the status number, and the address that was used is put in front of that text. The exception is a 3xx code other than 301, 302, 307 and 308: that gives Received disallowed redirect status code %d instead, and the four allowed redirects are followed first. Our own reading: the address in front is the server that answered, and a status of 404 means a server answered but had no such file.
The Let's Encrypt documentation says the validation fetches http://<YOUR_DOMAIN>/.well-known/acme-challenge/<TOKEN>, "follows redirects, up to 10 redirects deep", accepts only http: or https: redirects to ports 80 or 443, and does not check certificates on an HTTPS redirect. The Boulder source follows 301, 302, 307 and 308 only. It prefers the first IPv6 address of the name and has a fallback to IPv4, so an AAAA record counts as much as an A record.
The webroot method writes a temporary file under ${webroot-path}/.well-known/acme-challenge. The Certbot documentation says "your server must be configured to serve files from hidden directories", and that a rule treating /.well-known specially may need changing.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| The name resolves to another server, a parking page or an old host | The address in Detail is not yours | Compare the address with your server's public address |
An AAAA record points somewhere else |
The address in Detail is IPv6 and not yours | The name has an IPv6 record you did not set |
| The webroot path in Certbot is not the folder the site serves | Our own reading: the address in Detail is yours and the status is 404 | The path after --webroot-path differs from the server's root |
A server rule sends /.well-known/ to an application or denies it |
404 or another status from the application | The request returns the application's error page |
| A redirect leads to a host or site that answers 404 | Detail names the final URL | The headers show a Location line |
| The name has no virtual host, so the default server answers | Only one name of several fails | The default server's content is returned |
Prove the cause before changing anything
Steps 1, 2 and 4 only read. Step 3 is not read-only and has its own warning.
1. Write down the failure block. Note each Identifier, the Type, and the whole Detail line: the address, the URL and the status number. A final status other than 404 is the same message with another number, for example 403 or 500; a 3xx code other than 301, 302, 307 and 308 gives Received disallowed redirect status code instead, which is the disallowed-redirect form in the source.
2. Compare the address. If the address in Detail is not the public address of your server, the cause is DNS or another server, not your web server rules.
3. Run a dry run that pauses.
Risk: the next command asks the Let's Encrypt staging server to validate the name and writes a temporary challenge file under the webroot folder. It saves no certificate. Letting Certbot continue in the next step is how the run ends.
The Certbot documentation says --dry-run uses the Let's Encrypt staging server, and that --debug-challenges waits "for user input before submitting to CA", showing "the challenge URLs or FQDNs and their expected return values" when used with -v. Replace the path and name with yours.
certbot certonly --webroot -w /var/www/example -d www.example.com --dry-run --debug-challenges -v
4. While it waits, request the URL. From a machine outside your network, use the URL Certbot printed. The curl manual describes -i as --show-headers.
curl -i http://www.example.com/.well-known/acme-challenge/<token from the Certbot output>
A status 200 with the expected value means the path works, and the cause is elsewhere. A 404 with the wrong site's headers means a different server or virtual host answered. A 301 or 302 shows a Location line to follow; add -L and, for an HTTPS target, -k. The curl manual says -k makes curl skip certificate verification. Our own reading: this matches how the Let's Encrypt documentation says certificates are not checked on an HTTPS redirect.
Then let Certbot continue. The cleanup step in the Certbot 5.10.0 webroot source logs Removing %s and removes the validation file.
Fix
Choose the route that matches steps 2 to 4.
The name points at the wrong server
First save the current state: write down the current value of the A and AAAA records for the name, and the time.
Risk: the next change moves web visitors for that name to another server. Caching means some visitors reach the old address for a time, and the site stops working for them if the new address does not serve it.
At your DNS provider, set the record to the public address of your server, or remove an AAAA record that does not belong to it.
Risk: setting the record back moves visitors for that name back to the old address, and certificate checks fail again for the name.
Only if you need to back out: set the record back to the value you wrote down.
Then run the dry run from the Confirm the fix section as a separate step.
Certbot is using the wrong webroot path
First save the current state. The GNU manual says "cp copies files (or, optionally, directories)."
cp -p /etc/letsencrypt/renewal/example.com.conf /root/example.com.conf.2026-12-04
Risk: the next command changes the saved renewal options for this certificate. The Certbot page says it performs a test renewal against the staging server and, if that succeeds, saves the new options for future renewals.
For Certbot 2.3.0 and newer, the page gives this form. Replace the certificate name and the path.
certbot reconfigure --cert-name example.com --webroot-path /var/www/example
Risk: copying the saved file back over the renewal file discards the new path, and future renewals use the old path again.
Only if you need to back out: copy the saved file back over the renewal file.
cp -p /root/example.com.conf.2026-12-04 /etc/letsencrypt/renewal/example.com.conf
nginx does not serve the challenge folder
nginx serves a path from the folder named by root. The documentation example: with root /data/w3; in location /i/, the request /i/top.gif sends /data/w3/i/top.gif. The documentation says that if the longest matching prefix location has the ^~ modifier, "regular expressions and predicate locations are not checked". Our own reading: a prefix location with ^~ keeps the challenge path out of regular expression rules.
First save the current state:
cp -p /etc/nginx/conf.d/example.conf /root/example.conf.2026-12-04
Risk: the next edit adds a location to a live server block. A wrong root serves files from the wrong folder, and the change takes effect at the reload step below.
Add this inside the server block for the name, with your own webroot path. It must match the --webroot-path Certbot uses.
location ^~ /.well-known/acme-challenge/ {
root /var/www/example;
}
Risk: copying the saved file over the edited one discards the location you added.
Only if you need to back out before the reload: copy the saved file over the edited one.
cp -p /root/example.conf.2026-12-04 /etc/nginx/conf.d/example.conf
Run the test on its own.
nginx -t
The copy made above is the saved state. Keep it until the reload has been checked.
Disruptive step: the next command loads the new configuration and starts new worker processes. According to the nginx Beginner's Guide, a configuration that fails is rolled back and the old one keeps running.
nginx -s reload
Risk: the back-out below restores the saved file over the live one and then loads it with a second reload. The location you added is lost, and the answering configuration changes again.
Only if you need to back out after the reload, copy the saved file back.
cp -p /root/example.conf.2026-12-04 /etc/nginx/conf.d/example.conf
Then run the test on its own.
nginx -t
Then load the restored file with a second reload.
nginx -s reload
Example (illustrative): on web01, certbot renew for www.example.com fails with Invalid response from http://www.example.com/.well-known/acme-challenge/...: 404, and the address in Detail is 203.0.113.10, which is web01. The paused dry run shows the challenge file under /var/www/example, but the request returns the application's 404 page, because location / sends everything to the application. The administrator saves example.conf, adds the ^~ location with root /var/www/example;, tests, and reloads. The request then returns the expected value and the dry run succeeds.
Confirm the fix
- Run the dry run again without
--debug-challenges.
certbot renew --cert-name example.com --dry-run
- The run ends without
Some challenges have failed. - A real renewal later completes without a failure block.
What to watch afterwards
- The Let's Encrypt rate limits page says: "Up to 5 authorization failures per identifier can be incurred by one account every hour." The ability refills at 1 per identifier every 12 minutes. Test with the dry run, which uses staging, until it passes.
- The same page allows up to 1,152 consecutive authorization failures per identifier before the account is prevented from requesting new certificates for it; that ability refills at 1 per identifier every day.
- After a hosting move or a new redirect rule, run a dry run before the next renewal date.
- For other failure texts, see Certbot "DNS problem: NXDOMAIN looking up A for": the name Let's Encrypt cannot find and Let's Encrypt renewal failed: Timeout during connect (likely firewall problem).
Read next
Related articles you may want next.
- TroubleshootingCertbot "DNS problem: NXDOMAIN looking up A for": the name Let's Encrypt cannot findCertbot says DNS problem: NXDOMAIN looking up A for a name. Check spelling, A and AAAA records, delegation and CNAME targets, then retest with a dry run.Read article
- TroubleshootingLet's Encrypt renewal failed: Timeout during connect (likely firewall problem)Certbot renewal fails with Timeout during connect (likely firewall problem). Read the address in the message, test port 80 from outside, fix the cause.Read article
- HostingACME challenge types: choosing HTTP-01, DNS-01 or TLS-ALPN-01 for each certificateHow HTTP-01, DNS-01 and TLS-ALPN-01 validate a domain, what access each needs, and how to choose one per certificate so renewals keep working.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The Detail wording and the address prefix come from the Boulder source at the tag named above. Let's Encrypt can change it.
- The webroot example is for Certbot with the webroot method. Other authenticators print other hints.
- Changing a DNS record, a renewal file or a live web server configuration affects visitors. Make each change outside busy hours.
- Let's Encrypt says of the HTTP-01 challenge: "This challenge cannot be used to issue wildcard certificates." A wildcard name needs another method: ACME challenge types: choosing HTTP-01, DNS-01 or TLS-ALPN-01 for each certificate.
Sources
- User Guide — Certbot project, no date shown, accessed 4 December 2026
- Certbot 5.10.0 source: auth_handler.py — Certbot project, tag v5.10.0, no date shown, accessed 4 December 2026
- Certbot 3.0.1 source: auth_handler.py — Certbot project, tag v3.0.1, no date shown, accessed 4 December 2026
- Certbot 5.10.0 source: plugins/webroot.py — Certbot project, tag v5.10.0, no date shown, accessed 4 December 2026
- Challenge Types — Let's Encrypt, page dated 12 February 2026, accessed 4 December 2026
- Rate Limits — Let's Encrypt, page dated 5 August 2026, accessed 4 December 2026
- Boulder source: va/http.go — Let's Encrypt, tag v0.20261201.0, no date shown, accessed 4 December 2026
- Boulder source: va/va.go — Let's Encrypt, tag v0.20261201.0, no date shown, accessed 4 December 2026
- RFC 8555: Automatic Certificate Management Environment (ACME) — IETF, March 2019, accessed 4 December 2026
- Module ngx_http_core_module — nginx documentation, no date shown, accessed 4 December 2026
- Beginner’s Guide — nginx documentation, no date shown, accessed 4 December 2026
- curl man page — curl project, no date shown, accessed 4 December 2026
- cp invocation — GNU Coreutils 9.12 manual, no date shown, accessed 4 December 2026
- cp(1) — Linux manual page — Linux man-pages project, no date shown, accessed 4 December 2026
- Command-line parameters — nginx documentation, no date shown, accessed 4 December 2026
This article was originally published on .