# Unable to Generate SSL cert using docker-compose

**URL:** <https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938>\
**Category:** Help\
**Created:** [July 14, 2024, 12:55pm UTC](https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938 "2024-07-14T12:55:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamzajavid14](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/hamzajavid14/32/81393_2.png) [@hamzajavid14](https://community.letsencrypt.org/u/hamzajavid14)\
**Post date:** [July 14, 2024, 12:55pm UTC](https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938/1 "2024-07-14T12:55:49Z")

</div>

Hi,  
I'm using Docker Compose to auto-generate the SSL for my domain

version: '3.8'  
name: infra-main  
services:  
nginx:  
container\_name: infra-main-nginx  
image: [ghcr.io/rihal-om/infra-rihal-om/nginx:latest](http://ghcr.io/rihal-om/infra-rihal-om/nginx:latest)  
restart: always  
ports:  
- 80:80  
- 443:443  
volumes:  
- '/var/run/docker.sock:/tmp/docker.sock:ro'  
- 'vhost:/etc/nginx/vhost.d'  
- 'html:/usr/share/nginx/html'  
- 'certs:/etc/nginx/certs'  
- '/docker/volumes/infra-main/nginx/config:/etc/nginx/conf.d'

acme:  
container\_name: infra-main-acme  
image: nginxproxy/acme-companion  
restart: always  
volumes:  
- '/var/run/docker.sock:/var/run/docker.sock:ro'  
- 'acme:/etc/acme.sh'  
environment:  
DEFAULT\_EMAIL: [user@xyz.com](mailto:user@xyz.com)  
volumes\_from:  
- 'nginx'

volumes:  
vhost:  
html:  
certs:  
acme:

networks:  
default:  
name: shared-network  
external: true

Invalid status,domain-name:Verify error detail:151.104.132.210: Invalid response from [http://domain/.well-known/acme-challenge/53P1P7CDyRpr8BjCbPORc2wpmwOqoUQd6ORHuOaLE9I:](http://domain/.well-known/acme-challenge/53P1P7CDyRpr8BjCbPORc2wpmwOqoUQd6ORHuOaLE9I:) 404

How can I fix this?

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [July 14, 2024, 2:25pm UTC](https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938/2 "2024-07-14T14:25:37Z")

</div>

> [@hamzajavid14](#):
>
> Verify error detail:151.104.132.210: Invalid response from [http://domain/.well-known/acme-challenge/53P1P7CDyRpr8BjCbPORc2wpmwOqoUQd6ORHuOaLE9I:](http://domain/.well-known/acme-challenge/53P1P7CDyRpr8BjCbPORc2wpmwOqoUQd6ORHuOaLE9I:) 404

The "404" is an HTTP Not Found error. It means you are using an HTTP Challenge (probably webroot since you don't show command I have to guess). For webroot acme.sh places a challenge token file in the webroot folder you specify. The Let's Encrypt server then makes an HTTP request to your domain requesting that challenge file. But, your nginx says it was not found.

With multiple docker containers, this usually means the webroot folder for acme.sh is not your nginx `root` folder for this domain. Check your volume statements to be sure these map to the same location.

---

<div class="post-metadata">

**Author:** ![hamzajavid14](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/hamzajavid14/32/81393_2.png) [@hamzajavid14](https://community.letsencrypt.org/u/hamzajavid14)\
**Post date:** [July 15, 2024, 5:27am UTC](https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938/3 "2024-07-15T05:27:38Z")

</div>

This Docker Compose file was working before, I'm unable to understand what happened now. It was quite simple we just did docker-compose up and it verified the domain but now it is complaining this

The only part that is failing is at the end with the test acme-challenge.

When I curl an HTTP link I get a 404.

I have no idea how to fix this. I've been at it for a few days.

Any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [August 14, 2024, 5:27am UTC](https://community.letsencrypt.org/t/unable-to-generate-ssl-cert-using-docker-compose/221938/4 "2024-08-14T05:27:59Z")

</div>

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