Submitted by pingtech on Sun, 02/17/2019 - 01:28
I looked through the forums and the docs and multiple web searches, it seems that a lot of issues could be resolved (including mine) of having the ability to specify a template for Nginx directives. The generated one, while it works for some cases, is flawed in many regards. Compound this with it generating and overwriting existing modified directives has caused many a lot of grief.
What I would propose is a option to provide a user created template for the directives and eliminate the automatically generated one.
Status:
Active
Comments
Submitted by Murz on Wed, 03/20/2019 - 03:27 Comment #1
Seems now nginx config template for virtualhost is hardcoded into cgi files, as I see in /usr/share/webmin/virtualmin-nginx/edit_fcgi.cgi and other files.
Will be good to convert all dynamic variables to substitutions and generate config file via template text, like this works now with Apache config file: https://www.virtualmin.com/documentation/id%2Cserver_settings_and_templates
Submitted by JamieCameron on Sat, 03/23/2019 - 00:56 Comment #2
It would be tricky to allow the template to be defined entirely using substitution, because some of the params are generated using logic more complex than the template format can express.
What changes did you want to make exactly?
Submitted by Murz on Sat, 03/23/2019 - 01:11 Comment #3
For complex params we can use multiline block as substitution, eg {$FCGI_PARAMS}.
I need to use php-fpm host and port in several places of my custom nginx config, but can't do this, so I must manually edit nginx. Also I need domain name & user as substitution variables.
Submitted by JamieCameron on Sun, 03/24/2019 - 00:36 Comment #4
One option, if you're just making a few small changes to the default config, is to write a script that gets run after domain creation to automate the edits you want.