how can I resolve "502 Bad Gateway nginx/1.14.0 (Ubuntu)" ?

Posted October 30, 2019 40.6k views

Hi. I’m the new one want to use DigitalOcean and I must admit I don’t have many knowledge of server

I wanted to make blog with Ghost… but even I couldn’t see basic theme of Ghost

when I write on domain of web, I have got this error message

502 Bad Gateway
nginx/1.14.0 (Ubuntu)

I’m gonna let you know my progress

I created droplet and my ssh key. and I spent hard time because, permission of my public key was denied. but finally I solved this problem.
and console requested me my blog url. so I wrote my custom domain that connected my droplet ip address.
and I requested my ip address website. but I have got error.

I found some information so I could see my error.log file

this is my error.log file

2019/10/30 15:56:01 [error] 3570#3570: *1 connect() failed (111: Connection refused) while connecting to upstream, client: [SNIP - IP ADDRESS], server:, request: "GET /favicon.ico HTTP/1.1", upstream: "", host: "[SNIP - IP ADDRESS]", referrer: "http://[SNIP - IP ADDRESS]/"

please fix this problem T.T
and if you need to get more information, write comment please :) thx.

edited by MattIPv4
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
1 answer


As Jason mentioned this could be due to a lot of things, I would recommend trying the one click Ghost installation from the DigitalOcean market place:

This would automatically deploy the Ghose instance for you.

Let me know how it goes!