Add custom directive before Nginx Server Block

1 post / 0 new
#1 Wed, 10/02/2019 - 04:51
ctgkhaled

Add custom directive before Nginx Server Block

Hi, I was using the virtualmin LAMP stack with Ubuntu 16.04. However, I recently decided to move to Nginx and converted the LAMP stack to LEMP using the official guideline plus some googling.

The default virtualmin virtual server Nginx template is not sufficient and I made some changes to the /usr/share/virtualmin-nginx/virtual-feature.pl file to get what I wanted inside the server block including FastCGI cache related directives and additional location blocks. Unfortunately, I am finding it difficult to add the fastcgi_cache_path directive just before the starting of server block for each new virtual server.

Has anyone successfully achieved what I am trying to accomplish? Please help if you can with your valuable advice.

Thanks in advance.