diff --git a/templates/php_pool.conf b/templates/php_pool.conf
index e40c4cf4006eb27f14c082fa5d411e4fff1182bc..043a7623fbb58f513490ee4aa9620ead45590274 100644
--- a/templates/php_pool.conf
+++ b/templates/php_pool.conf
@@ -3,7 +3,11 @@ user = {{ item.jail.name }}
 group = {{ item.jail.name }}
 ;chroot = {{ jailroot }}/{{ item.jail.name }}
 chdir = /
+{% if php_fpm_socket %}
+listen = /var/run/php{{ php_version_main }}-fpm.sock
+{% else %}
 listen = 127.0.0.1:{{ item.jail.port }}
+{% endif %}
 
 ; Process manager
 pm = dynamic