502 Bad Gateway nginx (1.9.7) in Homestead [ Laravel 5 ] 502 Bad Gateway nginx (1.9.7) in Homestead [ Laravel 5 ] nginx nginx

502 Bad Gateway nginx (1.9.7) in Homestead [ Laravel 5 ]


Finally solved this here. I want to thank Miguel from laracast discussion.

You need to change your configuration file under:

/etc/nginx/sites-enabled

change line fastcgi_pass for

 fastcgi_pass unix:/run/php/php7.0-fpm.sock;

php7.0-fpm.sock is located under:

/var/run/php

Since the new VM uses php 7.* and your configuration file might have the php location for 5.6 version.

Then restart Nginx and PHP

sudo service nginx restartsudo service php7.*-fpm restart

7.3 and the xdebug version in Homestead 8..* are incompatible. Further info found here*


try this in /etc/php/7.0/fpm/pool.d/www.conf

listen.owner = nginxlisten.group = nginxlisten.mode = 0660

finally restart php7.0-fpm

service php7.0-fpm restart


I've got same error, 502 Bad Gateway (Ngix 1.blablabla)

It's EASY to solve it.

just type into your terminal.

if your VM is running:

vagrant reload --provision

else:

vagrant halt

and later:

vagrant up --provision