So I’m following this guide: https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx to use certbot inside a docker container. But when using the command below I get the error below. I tried connecting to the docker container and adding a file manually inside /usr/share/nginx/html/.well-known/acme-challenge
and was able to access it in my browser. Because of this I think maybe something is wrong with my dns records? but my website is available on the domain name so I’m not sure what exactly.
On one.com I added 2 A records:
celta.be -> server_ip
www.celta.be -> server_ip
My domain is: http://celta.be
I ran this command:
sudo docker run -it --rm \
-v /docker-volumes/etc/letsencrypt:/etc/letsencrypt \
-v /docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt \
-v /docker/letsencrypt-docker-nginx/src/letsencrypt/letsencrypt-site:/data/letsencrypt \
-v "/docker-volumes/var/log/letsencrypt:/var/log/letsencrypt" \
certbot/certbot \
certonly --webroot \
--register-unsafely-without-email --agree-tos \
--webroot-path=/data/letsencrypt \
--staging \
-d celta.be -d www.celta.be
It produced this output:
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for celta.be
http-01 challenge for www.celta.be
Using the webroot path /data/letsencrypt for all unmatched domains.
Waiting for verification...
Challenge failed for domain www.celta.be
Challenge failed for domain celta.be
http-01 challenge for www.celta.be
http-01 challenge for celta.be
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.celta.be
Type: unauthorized
Detail: Invalid response from
http://www.celta.be/.well-known/acme-challenge/l_YQt_hsJR7FTYte-W8TaWW5FE3KIZSqw4jBMzmbh-4
[116.203.228.136]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body>\r\n<center><h1>404 Not
Found</h1></center>\r\n<hr><center>nginx/1.17.4</ce"
Domain: celta.be
Type: unauthorized
Detail: Invalid response from
http://celta.be/.well-known/acme-challenge/BZHWlYYyVaFiasMrU5HHZ333Lx4h98XJusRiOt87yQ8
[116.203.228.136]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body>\r\n<center><h1>404 Not
Found</h1></center>\r\n<hr><center>nginx/1.17.4</ce"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My web server is (include version): nginx/1.17.4
The operating system my web server runs on is (include version):
docker os : Debian GNU/Linux 10 (buster)
host os: ubuntu 18.04
My hosting provider, if applicable, is:
dns: one.com
server hetzner.com
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): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you’re using Certbot): certbot 0.31.0