Waiting for HTTP-01 challenge propagation wrong status code '404', expected '200'
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
When setting up HTTPS for your domain using Let's Encrypt, a common challenge is the HTTP-01 challenge. This is one method used by Let's Encrypt to verify domain ownership. However, during this process, many encounter the following error: "Waiting for HTTP-01 challenge propagation: wrong status code '404', expected '200'." This error occurs during the verification step when the Let's Encrypt server tries to access a file served over HTTP on your domain but receives a 404 error instead of the expected 200 status code. This indicates that some issue is preventing the challenge from being served correctly.
In this article, we'll explore what this error means, why it might occur, and possible solutions to troubleshoot and resolve it.
Understanding the HTTP-01 Challenge
Let's Encrypt uses the ACME (Automated Certificate Management Environment) protocol to issue certificates. The HTTP-01 challenge is part of this protocol and works as follows:
- Challenge Generation: Let's Encrypt generates a unique token for your domain.
- Web Server Configuration: You need to serve a specific HTTP resource at
http://<your-domain>/.well-known/acme-challenge/<token>``. - Verification: Let's Encrypt attempts to retrieve the file. The server expects a 200 HTTP status code, confirming domain control.
Why "404 Not Found" Can Occur
Common Causes
- File Placement:
- The challenge file might not be in the correct directory or does not exist.
- Web Server Misconfiguration:
- The web server might not have correct permissions or configurations to serve files from the
.well-known/acme-challenge/directory.
- DNS Propagation:
- If you've recently updated your DNS records, changes might not have propagated fully across the internet.
- Cache Interference:
- Proxy servers or CDNs might cache an older version or a 404 error, preventing the challenge file from being correctly accessed.
- URL Rewrites/Redirects:
- Rewrite rules in
.htaccessor server configuration could redirect requests away from the.well-known/path.
Troubleshooting Steps
Verifying File Presence
First, ensure that the challenge file is present at the correct location:
- Local path typically used:
/var/www/your-domain/.well-known/acme-challenge/. - You can test manually retrieving the file through your browser or using
curl:

