Nginx connect() failed error
For me the problem was my php-fpm service wasn't running. You can check it by running:
service php-fpm status
and start it by running
service php-fpm start
Sometimes php-fpm might have broken instances running, preventing a restart. This command is a clean way to clear them out and restart php-fpm
killall -9 php-fpm; service php-fpm restart
update your configurations as mentioned before:
location ~ .php$ {try_files $uri =404;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_pass unix:/var/run/php5-fpm.sock;fastcgi_index index.php;include fastcgi_params;}
but don't forget to restart both nginx server and php-fpm after updating
sudo /etc/init.d/nginx restartsudo /etc/init.d/php-fpm restart