0

I have created Node Js API with mongoDB and on port 5000. It is working well in local PC. But when I upload to server and run the program, I am unable to access that API in local PC, it says "This site can't be reached". But the program also running smoothly on server.

The server installed with: - Node - Mongo - Git And Port 5000 rule added in firewall.

test team
  • 677
  • 3
  • 12
  • 27

1 Answers1

1

run following command in your linux server iptables -t nat -A OUTPUT -o lo -p tcp --dport 5000 -j REDIRECT --to-port 80 It will redirect 5000 to 80 but my advice is to open 5000 in your firewall.

PPShein
  • 13,309
  • 42
  • 142
  • 227