Search code examples
node.jsexpressportfirewalliptables

node server available at port 80, but specified 3000 (iptables)


i have a serious problem! I have set up my first root server and i have no experience with server security. I used to run some node apps on localhost but now i have to run a app on that server. The node app works. I have specified in my index.js file that the server listens on port 3000. The app loads without a problem on port 3000 but it is also available at port 80. WTF?

Currently my iptables file allows everything for testing purposes. The file looks like this:

-A INPUT -j ACCEPT
-A FORWARD -j ACCEPT
-A OUTPUT -j ACCEPT

if that makes any difference or it has something to do with my issue...

What is the reason for the app listening on port 80?

PS: The app is ONLY available at 80 and 3000, as soon as i tested. Im using the express framework btw...


Solution

  • I found the solution. I feel really stupid now :) i was playing around with iptables but i have no idea about this tool :-/ after blocking myself out 2 times, i found out that i was looking at the wrong file. There was a port redirect in my nat table...

    I simply couldnt see it because i was looking at the wrong file

    So nevermind :-) but thank you for your hint!