I have a Node.js application that is running and accessible from other VPS. However, I am unable to run the application on DigitalOcean.The code is the same and I am using the same method to install. though npm and node versions are also the same. The applications were installed successfully in the Digitalocean droplet but isn’t accessible on IP. I have tried both new droplets and NodeJS app. On the new droplet the ip simply shows “refused to connect” and on nodejs it shows “502 bad gateway”. p.s NodeJS app is running and online but still isn’t accessible via ip/domain
This textbox defaults to using Markdown to format your 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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
This sounds like an issue with your Nginx configuration. As you’re using a proxy like Nginx and encountering a “502 Bad Gateway” error, I could suggest the following:
sudo tail -n 50 /var/log/nginx/error.log
. This should provide more detailed information about the 502 error.If the port in the Nginx configuration does not match the port that your Node.js service is running on you would get the 502 error.
You could use the
netstat -plant
command to check what port your app is listening on.Let me know how it goes!
Best,
Bobby
Heya @floatingbluegreenseal,
It seems you are using Nginx as a reverse proxy, is that correct? Can you share your nginx configuration that is related to your App?
Additionally, have you allowed the IPs to be accessible through your firewall? Can you type in
And let me know the output.