wmnnd / nginx-certbot

Boilerplate configuration for nginx and certbot with docker-compose
MIT License
3.16k stars 1.17k forks source link

Challenges fail when using envsubst template for nginx configuration. #141

Open SolnLase opened 1 year ago

SolnLase commented 1 year ago

I've come across an issue where challenges didn't pass. After experimenting for a while I found out that binding nginx template file to a template file in /etc/nginx/templates/, except for just including a normal conf file in conf.d is causing this issue. How can I rewrite this script so it works with envsubst templates for conf files in conf.d?

pmeaney commented 8 months ago

HI @SolnLase check out this example I setup, using @wmnnd 's initial example.

I think taking a look at it will solve your question.

https://github.com/clicksandcodes/ccc-nginx-certbot/

It uses envsubst and nginx conf templates. I also template-ized the project's shell file. Edit the .env file to add your preferred domain or IP address. In four commands (their env var needs editing as well-- to add your domain or the IP, and your email address), you can get an http & https endpoint running.

the endpoints will be: