5

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?

Rome_Leader
  • 2,518
  • 9
  • 42
  • 73
Sahil Chauhan
  • 185
  • 1
  • 13

2 Answers2

7

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.

Piyush Patil
  • 14,512
  • 6
  • 35
  • 54
  • thanks it worked.. now a new problem is showing.. as when i am searching for my domain in google search. the result is shown as welcome to bitnami .. can you help me with this – Sahil Chauhan Aug 10 '16 at 19:59
  • That is totally a different issue and question. I am not that good with SEO and stuff. – Piyush Patil Aug 10 '16 at 20:00
0

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.

vielmetti
  • 1,864
  • 16
  • 23
  • how to run the proxy? running application on port 80 displayed error – Sahil Chauhan Aug 10 '16 at 17:46
  • Is this the stack you are running? https://docs.bitnami.com/aws/infrastructure/mean/#which-components-are-installed-with-the-bitnami-mean-stack If so then you may be constrained to the operations supported there "for security reasons". – vielmetti Aug 10 '16 at 17:51