First of all, thanks for this awesome open-source control panel — it’s truly the best option among all others!
I’m facing an issue while trying to create a custom template.
When I installed Hestia, I didn’t choose the option to install Apache + Nginx — I selected only Nginx (unchecked Apache) because I thought it would be one server or the other.
Now, if possible, I would like to keep it that way without having to reinstall everything.
I downloaded and installed Grav CMS (flat-file) in the /root
(public) directory, and it worked fine.
However, when I place a static site in the root and create a subfolder /grav
(with the CMS inside it), I’m unable to access it, because it needs to be redirected properly using a template (since I’m using only Nginx).
ChatGPT taught me that the .htaccess
file is missing in pure Nginx setups, so I would need to create a custom template — and I tried to do that.
I created gsubfolder.tpl
and gsubfolder.stpl
inside /usr/local/hestia/data/templates/web/nginx/
, but they never show up in the Hestia panel template options. I run
sudo systemctl reload nginx
sudo systemctl restart nginx
systemctl restart hestia
v-rebuild-web-domain Admin2 painel3.domainchanged.com
Even rebuild the site using control panel from Hestia. But give me some “error”
What am I doing wrong?
My manually optimized sites usually achieve 98–100 on PageSpeed Insights, and I’m worried that reinstalling the server would cause me to lose performance.
Inside my gsubfolder.stpl
, I have: `
#=========================================================================#
GRAV TEMPLATE
Based on Default Template
Web Templates and FastCGI/Proxy Cache | Hestia Control Panel
#=========================================================================#
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
location ~ /\.(?!well-known\/|file) {
deny all;
return 404;
}
location /grav/ {
root %docroot%;
index index.php index.html index.htm;
try_files $uri $uri/ /grav/index.php?$args;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
}
`