Hello, my name is Marco, this is my first post and I need some advices!
I have my new VPS, I’ve installed Hestia with nginx + php-fpm (without apache) as I’m more familiar using it as reverse proxy, the problem is that I created the template under “/usr/local/hestia/data/templates/web/nginx/php-fpm/” and I’ve created the “Domain” and assigned the template I’ve created.
The point is, that when I try to browse the added domain it will show me the default Success page of hestia (and not doing the proxy rules specified in my template) so, I ask to someone of you more expert, what am I doing wrong?
This is my template:
server {
include %home%/%user%/conf/web/%domain%/reverseproxy.conf*;
listen 80;
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;
}
}
On the first line I import “reverseproxy.conf” that I create for every domain to reverse proxy and it’s content it like this (I just specify the location / rule, so I can make it customizable for every domain)
It looks like you’ve set up a custom Nginx template for your domain in HestiaCP, but the default success page is still being shown, meaning the custom configuration is not being applied as expected. Here are some steps and tips to troubleshoot and possibly resolve the issue:
Check the Template File Permissions
Ensure that the template files you’ve created under /usr/local/hestia/data/templates/web/nginx/php-fpm/ have the correct ownership and permissions. The files should be owned by root and have permissions set to 644 to make sure they are readable by Hestia.
Validate Nginx Configuration
After applying your template, check the Nginx configuration for any errors that might prevent it from working correctly. You can do this with the following command:
nginx -t
If there are errors, resolve them before proceeding.
Reload Hestia and Nginx Configurations
Once everything is verified to be correct, make sure to reload both Hestia and Nginx to apply the changes:
systemctl restart hestia
systemctl reload nginx
Check the Generated Configuration File
Go and check the configuration file that Hestia generates for the domain. This is usually located in:
/home/your_user/conf/web/your_domain/nginx.conf
Ensure that the directives you’ve specified in your template are actually present in this file.
Verify reverseproxy.conf File
Ensure that the reverseproxy.conf file has been correctly created for the specific domain and contains the correct rules for the reverse proxy.
Browser Cache
If everything seems correct, try clearing your browser cache or using a different browser to verify that the changes are actually visible.
Following these steps should help you identify and resolve the issue. If the problem persists, it might be helpful to check the Nginx logs for more details on the errors:
Hi and thanks for your answer, but I’ve already done those steps but there’s no error in nginx, the template it’s applied succesfully to the domain (checked the nginx.conf and reverseproxy.conf too). Checking the error log it would have been a good advice but nginx it’s running succesfully, there’s no errors. I’m starting to think that it’s because of PHP-FPM, but I don’t know how to check.