Getting a 502 Bad Gateway message after reboot.

Posted November 2, 2013 15k views
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?
1 comment

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.

Submit an Answer
10 answers
Check the owner:group attributes. What's the output of ls -la /path/to/Ghost/directory/? If you see root:root sprinkled in there, execute sudo chown -R www-data:www-data /path/to/Ghost/directory/.
I did see root:root there, executed the command, restarted ghost but still no joy.
Restart Nginx: sudo service nginx restart
Firts , verify your permissions in your documenroot of nginx

Which users running nginx ? nginx or apache

And verify the logs of /var/log/nginx
how can I do that exactly? Sorry, I'm just new to a lot of this.
verify wich user running nginx

cat /etc/nginx/nginx.conf | grep user
user nginx;

and check your permission of document root chown -R nginx:nginx /var/www/site
It means that ghost is down. Try starting ghost:

sudo service ghost start
@Kamal, what if that gives me "ghost: unrecognized service"?

What does that mean?
npm start start Ghost but it's an unrecognized service.