Wednesday, 15 March 2017

Node.js server without port number on AWS

I am trying to deploy my node.js app on AWS and allow users to access it without entering the port number. Currently, the link to my AWS app is:

http://ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com:3001/

So I logged into my AWS console and tried to redirect traffic from port 80 to port 3001:

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3001

Then I restarted my server.

However, when I navigate to http://ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com, I get a Cannot GET / error.

Can someone help?

Thanks in advance!



via Trung Tran

No comments:

Post a Comment