I executed my localhost
and the page displayed the 502 bad gateway
message. This helped me:
- Edit
/etc/php5/fpm/pool.d/www.conf
- Change
listen = /var/run/php5-fpm.sock
tolisten = 127.0.0.1:9000
- Ensure the location is set properly in nginx.conf.
- Run
sudo service php5-fpm restart
Maybe it will help you.
Source from: http://wildlyinaccurate.com/solving-502-bad-gateway-with-nginx-php-fpm