Change defaults for all new NGinx sites, e.g. add 'client_max_body_size 30M;'

I’m deploying many new sites on Virtualmin, but I would like to edit the “master” NGinx template to add certain values on each new deploy.

Is this possible?


You go to /etc/nginx/nginx.conf and insert the value you want to.
This is a global setting.


Thank you so much @Yannis, I did find an UI way as well.

System Settings->Features and Plugins->NgInx website->Configure button then Additional Nginx directives for new virtual hosts

I’m currently experimenting with both to see which one will work best for our administration workflow.


Adding the global settings as Additional directives only seems to work for one line items. Our configuration we need the following:

location / { try_files $uri $uri/ /index.php?$query_string; }

This is for WordPress, and we need it per site. When we restore, this restored:

location / { }

An empty location line. I’ll do further experimentation and provide feedback.