Amazon EC2 – How to Set Up Port Forwarding

amazon ec2httpport-forwardingweb-serverwindows-server-2012

I have a web application running on Amazon EC2. It listens on port 9898.

I can access it by entering the ip address and port number.

e.g 1.2.3.4:9898

However, what I'd really like to be able to do is to not have to enter the port number.

Researching this, it looks like port forwarding might be the solution – i.e. forward http requests received on the default port (80) to my non-standard port (9898).

Is this the correct way to go? If so, how do I set this up on EC2?

If not, then how do I achieve what I want?

Thanks in advance for any help.

Update

I should have mentioned the EC2 instance is a Windows Server 2012 AMI.

Best Answer

The easiest way to do this without installing something yourself is putting an Amazon Elastic Load Balancer in front of the instance. These allow you to forward ports as you intend.