0

Here me out.

I know that port forwarding is only something you can do on a router, and all EC2's come with a public IP automatically, but I am running a web app that runs on port 8080 on my EC2 server (running Amazon Linux). It has apache installed and if you go to the IP address, it shows the index.html file in /var/www/html/. I would instead like for this IP to go to port 8080 without having to manually specify 123.123.123.123:8080. Is this possible to do with an Elastic IP? Additionally, I want to use Route53 to provision a human-readable dns name. My ideal scenario would be that someone types in "dumb-website-idea.com", and gets redirected to 123.123.123.123:8080. What is the easiest way to do this?

Thank you.

bcornw2
  • 25
  • 4
  • This is just basic Apache or Nginx proxy forwarding. What issue are you having? – stdunbar Apr 22 '20 at 19:45
  • I want to get a domain name and an HTTPS cert in front of it – bcornw2 Apr 22 '20 at 20:08
  • Take a look at something like [this](https://stackoverflow.com/questions/51120325/apache-tomcat-ssl-proxypass-and-proxypassreverse). I'm not sure what your backend software is but the concepts should be the same. Normally you don't expose the backend port (8080 in your example) but use the normal http (port 80) and https (port 443) instead. – stdunbar Apr 22 '20 at 20:31

1 Answers1

0

Domain names only convert into IP addresses. They cannot include port numbers.

Therefore, you will need to run something (eg nginx) on the instance that accepts traffic on ports 80 & 443 that redirects to your app on port 8080.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470