Sahil Chauhan
Sahil Chauhan

Reputation: 185

remove port no 3000 requirement from aws ec2 instance

I have hosted my MEAN project over aws ec2 (mean bitnami hvm) instance. It is running on port 3000 and I am able to access my instance in the following way: ec2-xx-xx-xx-xx.amazonaws.com:3000

I want to access the instance without the port number (3000), i.e.: ec2-xx-xx-xx-xx.amazonaws.com

How can I do this?

Upvotes: 5

Views: 2310

Answers (2)

Piyush Patil
Piyush Patil

Reputation: 14523

Run this port forward command on your EC2 instance.

sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000

And your port 80 will be redirected to port 3000.

Upvotes: 7

user2832874
user2832874

Reputation:

Run your application on port 80 instead of port 3000, or run a proxy (like nginx) that allows you to map ports and paths as needed.

Upvotes: 0

Related Questions