Hello world!
I’ve created a Ubuntu NodeJS 8.10.0 on 18.04 droplet.
I’ve deployed a Node.js app, tested on my computer.
I can reach my app from inside the Droplet.
curl http://localhost:3000
I can’t reach my app from my computer.
curl http://123.456.789.012:3000
This is not the real IP.
Any ideas?
Thank you!!!
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.
Greetings!
I would bet that your application is listening on 127.0.0.1, as opposed to the public interface. If you run
netstat -tulpn
you should see the applications listening, and it might look something like this:Notice on my system that systemd-resolve is listening on 127.0.0.1, so it is only reachable internally. Meanwhile, sshd is listening on 0.0.0.0 which means all interfaces, making it accessible both internally and externally.
Your application most likely defines this somewhere in it’s configuration, and can be adjusted. If you’re not sure where, maybe a grep through it’s code can help, something like:
Or even:
If it isn’t configured anywhere, it’s probably an assumed default and it is required that you specifically define the value to change it.
Jarland
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
worked for me, thanks in milllions
This comment has been deleted