502 error even though blog is running

SO every time i go to my sit samgrogan.tk it shows a 502 bad gateway. But when I run ghost ls its shows that the blog is running. So the trouble shooting on ghosts website for the error isnt helpful. I’m not sure what to do next to continue my debugging.

Could you please provide some context for your setup? Are you running the reccommended stack without any deviations? If not, what’s different? Are you using Ghost CLI, and if so, what version? Have you made any changes to the configuration files manually?

my cli is version 1.7.1. my original install was from digital oceans one-click install. I had to migrate everything from root to a new user because i couldn’t use the ghost cli from root any more. How do I check my config files again its been a long time since I’ve touched them.

In that case, there’s no need to worry!

Your best bet to find an error is to either use ghost log, or run ghost in the foreground (ghost stop && ghost run).

This is what I have from logs which doesn’t seem to have anything but i could be wrong.

[2018-04-18 04:40:46] INFO Model: User 
[2018-04-18 04:40:46] INFO Model: User 
[2018-04-18 04:40:47] INFO Model: Post 
[2018-04-18 04:40:47] INFO Model: Post 
[2018-04-18 04:40:47] INFO Relation: Role to Permission 
[2018-04-18 04:40:47] INFO Relation: Role to Permission 
[2018-04-18 04:40:48] INFO Relation: Post to Tag 
[2018-04-18 04:40:48] INFO Relation: Post to Tag 
[2018-04-18 04:40:48] INFO Relation: User to Role 
[2018-04-18 04:40:48] INFO Relation: User to Role 
[2018-04-18 04:40:53] WARN Theme's file locales/en.json not found. 
[2018-04-18 04:40:53] WARN Theme's file locales/en.json not found. 
[2018-04-18 04:40:54] INFO Ghost is running in production... 
[2018-04-18 04:40:54] INFO Ghost is running in production... 
[2018-04-18 04:40:54] INFO Your blog is now available on http://samgrogan.tk/ 
[2018-04-18 04:40:54] INFO Ctrl+C to shut down 
[2018-04-18 04:40:54] INFO Your blog is now available on http://samgrogan.tk/ 
[2018-04-18 04:40:54] INFO Ctrl+C to shut down 
[2018-04-18 04:40:54] INFO Ghost boot 3.888s 
[2018-04-18 04:40:54] INFO Ghost boot 3.888s

I forgot to add the error flag to the ghost log command - it should be ghost log -e :no_mouth:

It’s giving me a database migration error. thats the only error

In that case, run ghost setup migrate to ensure your database is up to date!

it ran with out error and then i restarted but still no change

What port does ghost ls show? 2368, 2369…? Is it the same port used in your Ghost’s /var/www/ghost/config.production.json, and also the same port for proxy_pass in your Nginx’s configuration files at /var/www/ghost/system/files/*.conf?

port 2369 let me google how to check those files and ill get back to you

I have no conf file in /var/www/ghost/system/files/ but as for the first one its the same port. the host in the config.production.json should that be the local host?

So maybe you have Ghost installed in a different place, other than the usual /var/www/ghost/. Anyway, there will be symlinks at /etc/nginx/sites-enabled

Yes, 127.0.0.1

You can try for example:

ls /etc/nginx/sites-enabled
cat /etc/nginx/sites-enabled/example.com-ssl.conf

And the rest of .conf files as well. See ports in Nginx’s proxy_pass lines.

well as it turns out i had no nginx config file in sites enabled so i made one and restarted nginx and now its working. awesome

OK, 502 could have been a number of things (configurations, permissions, etc.), but glad it’s working already. :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.