Thursday, 15 May 2014

Solution : Nginx 502 Bad Gateway Error

If you got 502 Bad Gateway Error in Nginx after updating software in your system.
Because of update in php-fpm this error may occur.

1. Edit /etc/php-fpm.d/www.conf

vi /etc/php-fpm.d/www.conf
And set listen line to look as follows:

listen = 127.0.0.1:9000

2. Now change nginx configuration files of each domain which may be in /etc/nginx/conf.d folder. in each file change

fastcgi_pass   unix:/tmp/php5-fpm.sock;
to 
fastcgi_pass 127.0.0.1:9000;

Restart nginx and php-fpm

And check in browser whether your site working or Not.

I hope It will work :)

Read More
Here We Write The Problems we face at different situations and Solutions to those problems.