How to create a custom nginx template

Post Reply
myvesta_pk
Posts: 1
Joined: Wed May 08, 2024 7:19 pm

Is there any way to create a custom nginx template that will not be overwritten due to a system update, and then use the custom template for my domain?

Tags:
User avatar
myVesta
Site Admin
Posts: 1012
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 11 times
Been thanked: 6 times

Code: Select all

cd /usr/local/vesta/data/templates/web/nginx
cp hosting.tpl mycustom.tpl
cp hosting.stpl mycustom.stpl
Then edit mycustom.tpl and mycustom.stpl as you want.

At the end, set that nginx template to your domain via the hosting panel, or via SSH by running (as 'root'):

Code: Select all

/usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'your-username' 'your-domain.com' 'mycustom' '' 'yes'
If you later modify mycustom.tpl or mycustom.stpl, you have to rebuild your live config files by running (as 'root'):

Code: Select all

/usr/local/vesta/bin/v-rebuild-web-domains 'your-username'
Do not modify /home/user/conf/web/ config files, because templates will overwrite those files soon or later (for example, when Let's Encrypt renews SSL).
Post Reply