(SOLVED)502 Bad Gateway

Mustafa Ülker
1 min readSep 25, 2019

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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response