502 Bad Gateway nginx error

Hi all, I am trying to set up a Ghost blog on DigitalOcean. I have the blog up and running, but I can only access it through its IP address. I purchased a domain name for it, and when I enter the domain name I get a 502 Bad Gateway / nginx error. But as I said, entering in the IP address works fine.

I’m all new to this, so I’m not sure what other information would be helpful at this point to get help from the community. But any ideas you have would be appreciated.

You have their tutorial here:

If I remember correctly you have to pass DNS through their servers, though it should work without this as well.

Usually 502 can be a bad config error, check your setup server name and other variables to be ok.

Can also check /var/log/nginx/error_log or site error log for hints about the issue.

Just reporting back in, the problem was that I was giving nginx a subdomain as my domain name and had not set up the subdomain with my domain hosting yet. Rookie mistake. I just ended up nuking the droplet (I hadn’t done much with it) and starting over, and everything’s fine now.

Thanks for the help.

1 Like

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