0

I have a node.js app which running nginx, which is working smoothly but the problem is that, when a user enters with IP address and port (ex:5.188.56.20:8010), he can observe the services that are running on this port.

How can I make it inaccessible for users?

Dave M
  • 4,514
  • 22
  • 31
  • 30
ali
  • 1

1 Answers1

0

I think there are at least two possible options you can use.

  1. Configure the firewall to block external traffic to port 8010 and let only nginx to proxy traffic to the nodejs app. (Assuming nginx is listening on port 80/443)
  2. Change nodejs app configuration to bind to localhost/internal network interface

From the security perspective setting up firewall is a preferred way to go. For example - adding rule to allow traffic to nginx only from the outside and other rule to block traffic to the nodejs app.

dzup4uk
  • 321
  • 1
  • 9