From 82d5cc2ab920776114721634faa798f0de9d71a2 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 20 Mar 2021 19:24:19 +0100 Subject: [PATCH] php proxy: use the unix socket when required. --- templates/nginx-virthost.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nginx-virthost.j2 b/templates/nginx-virthost.j2 index 47a3e44..3c383dc 100644 --- a/templates/nginx-virthost.j2 +++ b/templates/nginx-virthost.j2 @@ -136,7 +136,7 @@ server { {% elif location.php_target is defined %} try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass {{ location.php_target }}; + fastcgi_pass {% if phpfpm_listen_on_socket is defined and phpfpm_listen_on_socket %}unix:{% endif %}{{ location.php_target }}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REMOTE_ADDR $http_x_forwarded_for; @@ -300,7 +300,7 @@ server { {% elif location.php_target is defined %} try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass {{ location.php_target }}; + fastcgi_pass {% if phpfpm_listen_on_socket is defined and phpfpm_listen_on_socket %}unix:{% endif %}{{ location.php_target }}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REMOTE_ADDR $http_x_forwarded_for;