Is there an Amazon Web Services service which will translate ports, such as port 8001 to port 80?
I like to host multiple websites behind a single static IP address, and I use port forwarding to route the different ports to various web servers behind my firewall which does the port forwarding.
It would be nice if I could implement a table like this somewhere inside an AWS service:
Client requests mydomain.com:80
-> AWS Route 53 translates to 123.123.123.123:8001
-> My firewall port forwards 8001
to the web server inside the LAN.
If AWS does not offer this service, then is there another out of the box solution? I could write my own app to do this and run it on an EC2 instance, but I prefer to use an existing tool if one is available.
Sure, the AWS ALB can do this. Additionally, it now supports host-based routing, so you can point multiple names to the ALB and configure it to route each one separately.
Note: the ALB is only able to load balance requests to backend servers that are within AWS. It's not a general-purpose load balancing service that can be used anywhere. Typically you will deploy backend servers in private subnet of a VPC and then deploy an ALB in front of them to accept client requests.
I think you're confused about the role of DNS. The DNS knows nothing about ports. For the purposes of publishing a web site, DNS only maps a name to one or more IP addresses. Period. There is no way to have DNS "redirect" to a port or anything like that.
I wrote my own port translator in NodeJS, and I am submitting the code here in case anyone else wants to use it. It does encrypted connections with https certificates as well as plain text port 80. I run it on an EC2 t2.micro instance for $10 per month and it runs great.
The only catch it it requires the browser to support SNICallback so the proxy server can dynamically use the correct certificate for the domain requested.
This tiny app below leverages the http-proxy library for NodeJS.