Accessing hostname when traffic passed through AWS Application Load Balancer

Viewed 1962

For our application we are using AWS Application Load Balancer (ALB) and have a listener for HTTP: 80 to forward traffic to the TargetGroup.

The way we have setup our application is that we will have a number subdomains and need to access these original subdomains (companyA.something.com) from within the application. Currently the application sees the DNS name of the ALB itself.

So far I have tried to setup the subdomain (in Route53) a couple ways:

  1. Created subdomain as A record with ALIAS pointing to the ALB DNS Name
  2. Created Hosted Zone for subdomain adding NS records for the subdomain to the zone file for the parent domain http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingNewSubdomain.html

I discovered that these are basically the same and the application still sees only the ALB DNS Name.

Is there anyway for me to get the original subdomain my users are going to without overriding with the ALB DNS name?

Thanks in advance, Aaron

1 Answers

You need to check the HTTP HOST header. The framework you use should already be able to handle it for you.

Related