Question

How to directly access the server with a port without doing any reverse proxying?

hi i’m new to this, when i’m running my application, i can’t access my application with public ip and the port number, but i can successfully access after reverse proxying with nginx, how could i directly access the app?


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It could be that there is a firewall blocking external connections via that specific port, here are some ways to debug:

First - confirm that the port is definitely blocked externally by running telnet YOUR_IP_ADDRESS THE_PORT_NUMBER from the command line. For example: telnet 123.45.123.32 80 if you get a response:

Trying 123.45.123.32...
Connected to123.45.123.32.
Escape character is '^]'.

then the port is actually open and the problem might be on your local device.

Still not solved? Check if it is a software firewall, running on your Droplet:

  • UFW is a commonly used firewall control software, to check if it is running, run sudo ufw status verbose (full reference here)
  • IP Tables are the more complicated underlying functionality that UFW controls, if you run sudo iptables -nL you will see a list of any iptables rules that are blocking certain ports. If you just see:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

it means no ports are blocked.

Still not solved? Check if there’s a DigitalOcean cloud firewall blocking external connections: Go to your Droplet’s page in the Control Panel and click on the Networking tab. Are there any active firewall rules listed? Read more about Cloud Firewalls here