Challenge failed for domain(Docker + Nginx Container)

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. https://crt.sh/?q=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: iamgonzales.dev

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 /opt/example_dir/letsencrypt/letsencrypt-site:/data/letsencrypt
-v “/docker-volumes/var/log/letsencrypt:/var/log/letsencrypt”
certbot/certbot
certonly --webroot
–email stiefo.o@gmail.com --agree-tos --no-eff-email
–webroot-path=/data/letsencrypt
-d iamgonzales.dev -d www.iamgonzales.dev

It produced this output:

IMPORTANT NOTES:
 - The following errors were reported by the server:

Domain: iamgonzales.dev
   Type:   unauthorized
Detail: Invalid response from
http://iamgonzales.dev/.well-known/acme
challenge/nglK4V8YiySeza9XptQEfZcleMMouVKd6HEYwsPJYK0
[209.97.131.52]: "<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.19.1</ce"

Domain: www.iamgonzales.dev
Type:   unauthorized
Detail: Invalid response from
http://www.iamgonzales.dev/.well-known/acme- 
challenge/JaAlHJ_9mgQSKQW45iMgVfx7Wf0yppggonp-7QyBa8g
[209.97.131.52]: "<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.19.1</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):
DigitalOcean

The operating system my web server runs on is (include version):
Ubuntu 18.04.3 LTS

My hosting provider, if applicable, is:

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):

nginx.config
server {
listen 80;
listen [::]:80;

server_name iamgonzales.dev www.iamgonzales.dev;

location ~ /.well-known/acme-challenge/ {
    allow all;
    root /user/share/nginx/html;
}

root /usr/share/nginx/html;
index index.html;
}

docker-compose.yml
version: ‘3.1’

services:

letsencrypt-nginx-container:
container_name: ‘letsencrypt-nginx-container’
image: nginx:latest
ports:
- “80:80”
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./letsencrypt-site:/usr/share/nginx/html
networks:
- docker-network

networks:
docker-network:
driver: bridge

I am following this step-by-step:

1 Like

And your docker-compose.yml is placed in /opt/example_dir/letsencrypt/letsencrypt-site?

1 Like

Yes

root@docker-database:/docker/letsencrypt-docker-nginx/src/letsencrypt# ls
docker-compose.yml  docker-compose.yml.save  letsencrypt-site  nginx.conf  nginx.conf.save

Isn’t that a whole different directory? :face_with_raised_eyebrow:

1 Like

Yes, my mistake, Thank you!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.