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

3 posts / 0 new
Last post
#1 Thu, 09/19/2019 - 05:45
eugenevdm.host
eugenevdm.host's picture

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?

Sat, 09/21/2019 - 09:02
sintos

Hello,

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

Yannis

Mon, 09/23/2019 - 02:07
eugenevdm.host
eugenevdm.host's picture

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.

UPDATE:

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.

Eugene van der Merwe

https://vander.host WordPress Website Hosting, VPS Hosting, and Domain Registration

Topic locked