Getting a 502 Bad Gateway message after reboot.

  • Posted November 2, 2013

After installing some new themes on a Ghost droplet, rebooting it, I get a 502 Bad Gateway message. I didn’t change any other settings as far as I’m aware but I’m told this has something to do with my nginx configuration? Does anyone have any ideas on how I can fix this?


I’m facing same problem. Has anyone found solution?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

npm start start Ghost but it’s an unrecognized service.

@Kamal, what if that gives me “ghost: unrecognized service”? <br> <br>What does that mean?

It means that ghost is down. Try starting ghost: <br> <br><pre>sudo service ghost start</pre>

verify wich user running nginx <br> <br>cat /etc/nginx/nginx.conf | grep user <br>user nginx; <br> <br>and check your permission of document root chown -R nginx:nginx /var/www/site

how can I do that exactly? Sorry, I’m just new to a lot of this.

Firts , verify your permissions in your documenroot of nginx <br> <br> <br>Which users running nginx ? nginx or apache
<br> <br> <br>And verify the logs of /var/log/nginx

Restart Nginx: <code>sudo service nginx restart</code>

I did see root:root there, executed the command, restarted ghost but still no joy.

Check the <code>owner:group</code> attributes. What’s the output of <code>ls -la /path/to/Ghost/directory/</code>? If you see <code>root:root</code> sprinkled in there, execute <code>sudo chown -R www-data:www-data /path/to/Ghost/directory/</code>.