Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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;

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

share|improve this question

1 Answer 1

Did you mean:

try_files $uri /index.php?q=$uri;

Anyway there's no real way to do this. Virtualmin has no templates for nginx configuration, instead it fully parses config and makes it editable from the interface.

If you are good in perl you can try rewriting virtualmin files (maybe edit_server.cgi) as this is the source of new configuration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.