Php version in nginx php-fpm tpl


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

nginx does not know about this variable %backend_version%

The whole Internet shows an example with an abstract socket
but in practice this does not work, all sockets are divided by web domains

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.