DEV Community

Discussion on: Dynamic and Abstract Nginx

Collapse
 
suther profile image
Samuel Suther

Thanks for your post, it guide me in the right direction.

But what's heavily missing is where you show, what exactly to put into /etc/nginx/nginx.conf.template.
Do you only put:

${SERVER}
${LOG} 
Enter fullscreen mode Exit fullscreen mode

in there?

A hint for those who need to execute this envsubst-command via sudo:

Use sudo -i, else you'll got an error like this: -bash: nginx.conf Permission denied

Collapse
 
aakhtar3 profile image
aakhtar3

Yes, you put the variable reference in the template.

You need to have the variables defined in scope before interpolating and generating the final config.