Valian / docker-nginx-auto-ssl

Docker image for automatic generation of SSL certs using Let's encrypt and Open Resty
https://hub.docker.com/r/valian/docker-nginx-auto-ssl/
MIT License
411 stars 103 forks source link

No certificate created #9

Closed GaetanLhoest closed 5 years ago

GaetanLhoest commented 5 years ago

Hi, I'm trying to use your docker with the command

docker run -d   --name main-nginx \
    --restart on-failure \
    -p 80:80   -p 443:443 \
    -e ALLOWED_DOMAINS=www.scaniat.io,dev.scaniat.io,www.dev.scaniat.io,scaniat.io \
    -e SITES='scaniat.io=scaniat-frontend-master;dev.scaniat.io=scaniat-frontend-develop' \
    --network custom \
    valian/docker-nginx-auto-ssl

but I keep getting that the website is not secured, and the certificate I see is the fallback one. I have no logs of the certificate creation with let's encrypt.

Do you see something I'm doing wrong?

(ps: scaniat-frontend-master and scaniat-frontend-develop are dockers on the same network (custom) with nginx running in, listening on the port 80, serving static websites.

Valian commented 5 years ago

Hi @GaetanLhoest

  1. ALLOWED_DOMAINS should be a Lua regexp pattern, please look into README. In your case, ([a-z.]+.)?scaniat.io should do.
  2. I'm not sure, but probably you have to specify ports in your SITES env variable: SITES='scaniat.io=scaniat-frontend-master:8080;dev.scaniat.io=scaniat-frontend-develop:8000'. But if they are listening on port 80, it may not be needed.

Try this, hope it will help :)