americanintel
Verified User
In /usr/local/directadmin/data/users/username/ngninx.conf it states:
However these help files are geared towards Apache.
We need some custom templates so we don't have to redo the nginx.conf files when DA overwrites them. The changes are simple but could become time consuming once we have more than a few and can cause downtime.
For example, we have some 'rewrites':
and some default root directory changes.
How would we go about creating templates for Nginx?
# Auto generated nginx config file by DirectAdmin version 1.45.4
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website
# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
However these help files are geared towards Apache.
We need some custom templates so we don't have to redo the nginx.conf files when DA overwrites them. The changes are simple but could become time consuming once we have more than a few and can cause downtime.
For example, we have some 'rewrites':
Code:
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# deny access to apache .htaccess files
location ~ /\.ht {
deny all;
}
include /etc/nginx/webapps.conf;
}
and some default root directory changes.
Code:
root /home/username/domains/domain.net/public_html/public;
How would we go about creating templates for Nginx?