Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: members.appz.ng
I ran this command:
It produced this output: Error: Let's Encrypt validation status 400 (members.appz.ng). Details: 403:"195.35.56.229: Invalid response from http://members.appz.ng/.well-known/acme-challenge/CZ_cXIJr3qDfBdrppPE_RH66y9gk3f589xuz0skaBzA: 404"
My web server is (include version): nginx
The operating system my web server runs on is (include version): Ubuntu 22.04
My hosting provider, if applicable, is: Hostinger
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): HestiaCP
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): Not sure which client is in use.
The "404" in the error is an HTTP Not Found error. In this case it is likely some configuration issue between your HestiaCP which requests the cert and your nginx server. The CP should be placing a token file or adjusting your nginx conf to reply to Let's Encrypt when it validates your domain. The 404 means it did not do that.
This is probably best handled by Hostinger support. They know best how HestiaCP should work with your account setup.
I see that requests to your domain are currently using a cert with the domain name websguy.com.ng. Do you recognize that? Maybe you just need to adjust your DNS to use the IP address for your members.appz server?
Adding to what MikeMcQ said: a 404 on the /.well-known/acme-challenge/ URL means Let's Encrypt did reach a web server on that IP, just not one that serves the token. So DNS and the firewall are probably fine, and the vhost that answers for members.appz.ng on port 80 isn't the one HestiaCP wrote the token into.
Things worth checking:
- Make sure members.appz.ng is added in HestiaCP as a Web domain (or alias) with exactly that name, and that its A record points to this server's IP. A domain that only exists in DNS won't get the challenge location.
- Look at what nginx answers on port 80 for that hostname: curl -I http://members.appz.ng/ and compare with curl -I -H 'Host: members.appz.ng' http://127.0.0.1/ . If you get a different site or a default page, another server block is catching the request.
- Check there is no redirect or rule (for example a catch-all location or a proxy to an app) that intercepts /.well-known/ before the Hestia ACME location.
- Mike also noticed the certificate served for this name belongs to a different domain, which fits the idea that requests are landing on the wrong site.
Once a test file placed in that web root's .well-known/acme-challenge/ folder loads over plain HTTP from outside, issuance should succeed. If it still fails, please post the output of the curl commands above.
On HestiaCP, a 404 on /.well-known/acme-challenge/ when issuing a cert for a new subdomain usually happens because the nginx proxy template for that web domain hasn't linked the nginx.conf_letsencrypt include file yet (or custom proxy rules are intercepting the location block before the ACME alias).
Run these two checks on your Hestia server as root:
- Check if /home//conf/web/members.appz.ng/nginx.conf_letsencrypt exists and is included inside /home//conf/web/members.appz.ng/nginx.conf. It should map /.well-known/acme-challenge/ directly to /home//web/members.appz.ng/public_html/.well-known/acme-challenge/.
- Run v-rebuild-web-domain members.appz.ng and then test placing a plain text file in /home//web/members.appz.ng/public_html/.well-known/acme-challenge/test.txt to confirm curl -I http://members.appz.ng/.well-known/acme-challenge/test.txt returns HTTP 200 before re-running v-add-letsencrypt-domain (so you don't burn your Let's Encrypt failed-validation rate limit).
Alright. I will try this.
I used Gemini to troubleshoot the errors and it asked me to check the conf file and saw this
location ~ /.(?!well-known/|file) {
deny all;
return 404;
}
Changing it to
location /.well-known/acme-challenge/ {
allow all;
try_files $uri =404;
}
location ~ /.(?!well-known|file) {
deny all;
access_log off;
log_not_found off;
}
I also turned off Redirect to HTTPS, and ran v-add-letsencrypt-domain, and it worked. I need to figure out how to make it permanent.
Thank you all.
Glad that got your certificate issued!
To make that .well-known/acme-challenge/ rule permanent in HestiaCP so v-rebuild-web-domain or Hestia updates never overwrite it:
- Put your custom
location /.well-known/acme-challenge/ block inside /home/<user>/conf/web/members.appz.ng/nginx.conf_custom (HestiaCP automatically includes nginx.conf_* files inside the server block and preserves them across rebuilds).
- Alternatively, make sure
/home/<user>/conf/web/members.appz.ng/nginx.ssl.conf_letsencrypt is symlinked alongside nginx.conf_letsencrypt so once you turn Redirect to HTTPS back on, port 443 serves the exact same /.well-known/acme-challenge/ alias during 60-day automated renewals.
- Test with
nginx -t && systemctl reload nginx and verify curl -I https://members.appz.ng/.well-known/acme-challenge/test.txt with HTTPS redirect re-enabled.