(SOLVED)502 Bad Gateway
tail -f /var/log/nginx/error.log
First make sure the error is
[crit] 1551#1551: *19 connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: _, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “localhost”
SOLUTION:
nano /etc/nginx/sites-enabled/default
change
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
as
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
than restart the service by
sudo service nginx restart