Question

My server only works on localhost but not works on ip address.

Hello, I’m using ubuntu 20.04 droplet. I’ve seen many tutorials that talked me that I don’t need many things to see my app run on the internet. They said that just run “pm2 start app_name” and then I can see my website on the internet by send my browser to “server_ip_address(ipv4):port_number”. In video, that works. But not for me.

When I try “curl http://localhost:port_number” or “curl http://127.0.0.1:port_number” in server connected bash, it works. But when I try to connect by ip address outside of server computer(or bash) the browser load page endlessly. I can’t get any logs both in digitalocean graph and pm2, about my attempt using ip address.

It happens even before I install nginx to server. I’ve heard that after install nginx, i can default nginx html when I get to my server ip address, but that also does not work.

Why does this happens? I can’t get where does this problem comes from. Because I use ipv6? Or because I set firewall which is in doc “Recommended Initial Droplet Configuration” (https://www.digitalocean.com/docs/droplets/tutorials/recommended-setup/)? And how can I solve that?

“netstat -plant | grep port_number” gives me this. tcp6 0 0 :::port_number :::* LISTEN PID/node

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

I do the following steps https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04 But after get done and show the status ACTIVE. I typed HTTP://my_ip_address => I can not connect to the NGINX server. But when I typed the same thing inside droplet and it worked.

I am having the Same problem, not able to access apache, nodejs and other server from outside world by can access from localhost. Please tell the complete solution fast. I am using your ubuntu server, and I facing big problem in this.

Hi @ecrout,

Can I ask you to provide us with your Nginx configuration file for your domain or default configuration file to see if there is anything that is out of order inside of it?