0

I have a Node.js express website that was listening on port 9000, the thing which was fine until I changed the port to 80, now it accepts only connection from local:

wget http://127.0.0.1/ -O -
curl 127.0.0.1:80

Locally it's working fine and they return the html page. But it does not accept remote connections from browser, either using the external IP address or the domain name.

# iptables

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
Dhanu Gurung
  • 8,480
  • 10
  • 47
  • 60
EvilThinker
  • 740
  • 1
  • 9
  • 13
  • Can you post the output of `netstat -anpt`? – Joel C Nov 06 '15 at 01:16
  • please show us the (relevant) config of your `Node.js` instance, where you configure the port: it's easy to configure a server that only accepts connections on a speficic interface (e.g. `lo`) – umläute Nov 06 '15 at 14:30
  • thank you guys for your interest in helping me, i have figured it out, the port forwarding rules was redirecting connections from port 80 to another port – EvilThinker Nov 06 '15 at 15:15

1 Answers1

0

Well, i have figured the issue, it was my iptables rules forwarding remote connections from outside to another port.

EvilThinker
  • 740
  • 1
  • 9
  • 13