Nginx-Virtualmin virtual server template

4 posts / 0 new
Last post
#1 Tue, 06/12/2012 - 02:01
zulkhaery

Nginx-Virtualmin virtual server template

I want to edit nginx server template. I want every new virtual server created to use some specific nginx server configs and location settings.

I want to add this line each time virtualmin created a server:

 if (!-f $request_filename) {
                    rewrite ^/(.*)$ /index.php?q=$1 last;
                break;
           }  

Where can i find it? or what is the best way to add these line automatic ?

Tue, 07/10/2012 - 11:23
PlayGod

Yes, I would also like to know the location of the nginx template.

I am setting up a server on which I want to deploy multiple virtual servers with Wordpress automatically installed via customized script installer (with a set of plugins and themes already loaded).

Wordpress requires a few tweaks to nginx.conf, and also has a local nginx.conf for each virtual server (created by W3 Total Cache plugin).

Therefore, it would be helpful to add these changes to the nginx template, similar to the way we can change the base php.ini to be a template for the virtual servers' local php.ini's.

Fri, 04/18/2014 - 17:40
soju

The file you need to edit is:

/usr/share/webmin/virtualmin-nginx/virtual_feature.pl

I wrote up a quick how to on adding WordPress permalinks directly to this file so they're added when a new Virtual Host is created

http://supersoju.com/blog/2014/04/18/enabling-wordpress-rewrite-rules-de...

Sat, 12/27/2014 - 12:33
amityweb

For info, on my server (Centos) its in the folder /usr/libexec/webmin/virtualmin-nginx

Be great to have it added to the Default Settings section in Server Templates. I need to add a LOT of new lines for Expression Engine, and seems quite tricky editing the file directly.

Topic locked