Rajesh
Rajesh

Reputation: 556

Passing 'sub-domain' through ELB to server

Context: I have multiple sub-domains under a domain example: abc.domain.com, xyz.domain.com, lmn.domain.com etc.

I have added a load balancer to my server and the server needs the sub-domain (in above eg: abc, xyz, lmn etc) to resolve to some functionality.

Issue: What should I use so that I can achieve this functionality?

Probable solutions: - Can I pass sub-domain name as a header from my application? - Can I append sub-domain as a "/path" to URL from my application and then ELB will work as per "host routing mechanism".

Upvotes: 0

Views: 93

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 178956

The (sub)domain name requested by the browser should already be there, in the HTTP Host header of each request.

Can I append sub-domain as a "/path" to URL from my application and then ELB will work as per "host routing mechanism".

No, you can't. Per-hostname routing uses the Host header to select a different target group, when you have multiple groups or instances or services configured with multiple target groups behind one Application Load Balancer. The path isn't modified by ALB.

Upvotes: 2

Related Questions