wmnnd/nginx-certbot

Challenges fail when using envsubst template for nginx configuration.

Opened this issue · 1 comments

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?

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:

  • http://yourDomain.com/healthcheck
  • https://yourDomain.com/healthcheck