Best place to put Nginx config files?

Hello,

I tried to follow documentation, but still a bit confused about the best way to go about creating web templates. My server is hosting multiple domains and subdomains. Each requires a unique Nginx config file. According to the doc, they have to be templates to avoid them being overwritten.

After some experimenting, I found out that placing template files in /usr/local/hestia/data/templates/web/nginx/php-fpm makes them appear in “Web Template NGINX” under “Advanced Options” for the domain in Hestia UI.

Is /usr/local/hestia/data/templates/web/nginx/php-fpm the best place to put all domain config files? It seems that it would be cleaner to keep them in separate domain folders, such as /home/admin/conf/web/<domain.tld>, not together with templates that are used for multiple domains.

Why do they need to be in the php-fpm subfolder as opposed to in /usr/local/hestia/data/templates/web/nginx/? The doc says that only the “config templates for the PHP pool” supposed to be in there, but placing templates in /usr/local/hestia/data/templates/web/nginx/ does not make them appear in the UI.

The doc says the templates must be named like YOURNAME-PHP-8_1.tpl, but none of the existing templates, e.g. codeigniter, etc. are named like that. When does that rule apply?

The doc also says that each time a template is modified, v-rebuild-user needs to be run. I did not have to do that. The correct config file appears in /home/admin/conf/web/<domain.tld> after selecting it in the UI. What is v-rebuild-user for?

I installed Hestia with these params:

bash hst-install.sh --api no --apache no --vsftpd no --password password --email [email protected] --hostname www.domain.tld --interactive no

Documentation: Web Templates and FastCGI/Proxy Cache | Hestia Control Panel

/usr/local/hestia/data/templates/web/nginx/php-fpm is the correct location