Php version in nginx php-fpm tpl

Hi!

After each update of the panel, my server crashes, because the nginx template is reset to the default template /usr/local/hestia/data/templates/web/nginx/php-fpm/default.stpl
I try to make my own nginx template for web domains, but how to get the php version in it?

How replace php version in nginx.tpl for current used php-version on website?
set $php_sock unix:/run/php/php7.4-fpm-%domain%.sock;
like this
set $php_sock unix:/run/php/php%backend_version%-fpm-%domain%.sock;

This in php-fpm PHP-7_4.tpl, but it doesn’t work in nginx.tpl
/run/php/php%backend_version%-fpm-%domain%.sock

nginx does not know about this variable %backend_version%

The whole Internet shows an example with an abstract socket
/var/run/php-fpm/php-fpm.sock
but in practice this does not work, all sockets are divided by web domains
/run/php/php7.4-fpm-example.com.sock;

v-add-web-php x.x to add support for that version

Then: you can select the templates for each version.

This var %backend_lsnr% helped me, thanks!

set $php_sock %backend_lsnr%;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.