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

Add fallback to a self-signed certificated #51

Closed slavikme closed 3 years ago

slavikme commented 3 years ago

Hi,

First of all, thank you for this great image!

A question: Is it possible to add a fallback to a self-signed certificate, like running it on a LAN or in a dev environment for example?

Valian commented 3 years ago

Thanks @slavikme!

It's working like this by default - if it's impossible to generate a certificate or a domain does not match ALLOWED_DOMAINS, then self-signed certificate is used. It's generated during docker image build, and specified in https://github.com/Valian/docker-nginx-auto-ssl/blob/master/snippets/resty-server-https.conf.

Read more in resty-auto-ssl README https://github.com/auto-ssl/lua-resty-auto-ssl

Anyway, I'm almost always trying to do not use HTTPS in dev.