Hello,
Context : I am running nginx inside Docker so I have no nginx neither certbot installed on my OS.
My domain is:
My file tree on my server (absolute path):
/home/user/webby/docker-compose.yml
/home/user/webby/index.html -> the page I'd like to acces from the browser using HTTPS connection.
/home/user/webby/data/certbot/conf/accounts
/home/user/webby/data/certbot/conf/csr
/home/user/webby/data/certbot/conf/keys
/home/user/webby/data/certbot/conf/renewal
/home/user/webby/data/certbot/conf/renewal-hooks
/home/user/webby/data/certbot/www
/home/user/webby/data/nginx/app.conf
app.conf :
server {
listen 80;
listen [::]:80;
server_name enigmadock.fr www.enigmadock.fr;
server_tokens off;location / { return 301 https://enigmadock.fr$request_uri; } location /.well-known/acme-challenge/ { root /var/www/certbot; }
}
server {
listen 443 default_server ssl http2;
listen [::]:443 ssl http2;server_name enigmadock.fr; location / { }
}
docker-compose.yml :
version: '3'
services:
nginx:
image: nginx:latest
ports:
- 80:80
- 443:443
restart: always
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
certbot:
image: certbot/certbot:latest
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
What I don't understand is after running the command:
sudo docker compose run --rm certbot -v certonly --webroot --webroot-path=/var/www/certbot -d www.enigmadock.fr
My output is:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for www.enigmadock.fr
Performing the following challenges:
http-01 challenge for www.enigmadock.fr
Using the webroot path /var/www for all unmatched domains.
Waiting for verification...
Challenge failed for domain www.enigmadock.fr
http-01 challenge for www.enigmadock.frCertbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: www.enigmadock.fr
Type: unauthorized
Detail: x.x.x.x: Invalid response from http://www.enigmadock.fr/.well-known/acme-challenge/roVLhlKKjshIAcoeFDsarUfa3dtBYUggvlfmnXu8HGE: 404Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Cleaning up challenges
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
After reading about 25 different tutorials and reading threads exposing similar issues, I had to open a http.server with python3 to make the /.well-known/acme-challenge/ accessible.
Obviously, I can access enigmadock.fr/.well-known/acme-challenge/ without any issues and, to my biggest surprise:
After running the command above, I could read the following output on my python3 http server console:
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/nginx/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/www/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/.certbot.lock HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/renewal/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/renewal-hooks/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/02ff4db8182232b660118ef64cdd57b0/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/02ff4db8182232b660118ef64cdd57b0/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/02ff4db8182232b660118ef64cdd57b0/meta.json HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/02ff4db8182232b660118ef64cdd57b0/private_key.json HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/02ff4db8182232b660118ef64cdd57b0/regr.json HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0000_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0001_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0002_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0003_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0004_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0005_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0006_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0007_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/csr/0008_csr-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0000_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0001_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0002_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0003_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0004_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:37] "GET /webby/data/certbot/conf/keys/0005_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/keys/0006_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/keys/0007_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/keys/0008_key-certbot.pem HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/deploy/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/post/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/pre/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/deploy/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/post/ HTTP/1.1" 200 -
35.195.93.98 - - [12/Jun/2022 16:18:38] "GET /webby/data/certbot/conf/renewal-hooks/pre/ HTTP/1.1" 200 -
On a DNS standpoint, all A records are up and running pointing to my IP with (*), www and @ subdomains.
I am a bit desperate, its been days I am trying to fix this, and I could not figure this out. I must have missed something obvious....
Any hints?
Thank you