When updating Laravel Homestead to a newer version, in some case, there can be a Nginx 502 Bad Gateway error.
You can solve this by:
- Go to /var/log/nginx and view your test domain’s .log file.
- In our case we saw an error like:
*10 connect() to unix:/var/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream. - In our case, just a restart of PHP was enough:
sudo service php7.4-fpm restart
Replace php7.4 with your PHP version.
This solved it for us.
Did you find another cause and solution? Let us know in the comments.