0

I have multiple target groups (each for one [Streamlit] application) and I'd like to assign each of them to a subdomain (obviously, using the Host header).

What's the best way to route them through the same ALB: Is it better to have multiple listeners (i.e. one listener for every target group)? or one listener with multiple rules (i.e. one for each pair of host header and target group)?

Is there a preference here? Does any of the options count as an anti-pattern?

Thanks.

Babak Tourani
  • 419
  • 2
  • 6
  • 18
  • 1
    See [How can I set up host-based routing using an Application Load Balancer? 2 minute read](https://repost.aws/knowledge-center/elb-configure-host-based-routing-alb) and [here](https://pfisterer.dev/posts/multiple-domains-aws-lb/). – jarmod Apr 22 '23 at 11:33
  • 1
    You can't have multiple listeners on the same port. Instead, you would have a single listener, with multiple host header rules that point to different target groups. – Mark B Apr 22 '23 at 13:03
  • Thank you, @MarkB! Very important point. I had completely ignored that. Thanks @jarmod for the link! – Babak Tourani Apr 22 '23 at 14:16

0 Answers0