I want to use the default fastcgi template and won't prefer to build my own. So the problem is that I receive 502 Bad Gateway. I figure out that the /etc/php5/fpm/pool.d/www.conf has this kind of setting:
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php5-fpm.sock ### Note-1: we have to deal with this line.
But puppet-nginx will generate this kind of setting:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
### Note-2: this line won't match Note-1.
fastcgi_pass unix:/var/run/php5-fpm-www-data.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
This above is generated from puppet-nginx/templates/vhost/vhost_fastcgi.erb:
So the solution to get rid of 502 Bad Gateway is inject <%= @real_owner %> in /etc/php5/fpm/pool.d/www.conf like this:
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php5-fpm-<%= @real_owner %>.sock ### Note-1: This is the solution how to achieve this kind of settings.
I am using
netmanagers/puppet-nginx
andexample42/puppet-php
for vagrant machine. I have installed the php module like this:I want to use the default fastcgi template and won't prefer to build my own. So the problem is that I receive 502 Bad Gateway. I figure out that the
/etc/php5/fpm/pool.d/www.conf
has this kind of setting:But
puppet-nginx
will generate this kind of setting:This above is generated from
puppet-nginx/templates/vhost/vhost_fastcgi.erb
:So the solution to get rid of 502 Bad Gateway is inject
<%= @real_owner %>
in/etc/php5/fpm/pool.d/www.conf
like this: