-1

I have my brand new website hosted on amazon ec2:

As you can see, it is exposed on port 8020 because 80 is already in use by another web service.

I'd like my domain (hosted on godaddy) to point to that website. I know it is not possible to point to port 8020 with a A or CNAME record. It's not clear if it's possible with SRV or other ways. I tried this, but it does not work:

SRV redirection

Any help ?

Robycool
  • 1,104
  • 2
  • 14
  • 26
  • 1
    It is technically possible to do this with `SRV` records because they were designed exactly for this... but for that to work the application needs to use them. And web browsers do not take them into account, and this will not change soon and maybe never. Hence you will need a web proxying setup somewhere to translate the port, besides the DNS resolution to find the host. – Patrick Mevzek Jun 23 '19 at 08:29

1 Answers1

1

You can add an Application Load Balancer in front of your instance which can forward traffic to 8020 and have CNAME mapping to ALB url.

deosha
  • 972
  • 5
  • 20
  • Do you know a good resource that explains this? I am using docker and could add e.g., an nginx instance. What's not clear to me is how the load balancer can retrieve the original url to perform the redirect to the right port. – Robycool Jun 24 '19 at 08:37
  • https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html You may accept the answer if it works for you – deosha Jun 24 '19 at 08:38
  • It wasn't as straightforward as I hoped, but I got it to work. In amazon, the redirect can be done on the host header (i.e., the original url). – Robycool Jul 08 '19 at 14:23
  • Did ALB hell you out? – deosha Jul 08 '19 at 14:26