Bird
0
0

What happens when a request arrives with host header api.example.com?

medium📝 Predict Output Q4 of 15
AWS - Elastic Load Balancing
An ALB has two target groups: tgA and tgB. A listener rule forwards requests with host header app.example.com to tgA and all other hosts to tgB. What happens when a request arrives with host header api.example.com?
AThe ALB returns a 404 error because the host header does not match.
BThe request is routed to target group <code>tgA</code>.
CThe request is routed to target group <code>tgB</code>.
DThe ALB forwards the request to both <code>tgA</code> and <code>tgB</code> simultaneously.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the listener rule

    The ALB listener rule routes requests with host header app.example.com to tgA.
  2. Step 2: Analyze the incoming request

    The request has host header api.example.com, which does not match app.example.com.
  3. Step 3: Determine routing behavior

    Since the host header does not match the rule, the ALB routes the request to the default target group, which is tgB.
  4. Final Answer:

    The request is routed to target group tgB. -> Option C
  5. Quick Check:

    Host header matching routes to specified target group; unmatched goes to default [OK]
Quick Trick: Host header rules route matching hosts; others go default [OK]
Common Mistakes:
  • Assuming unmatched hosts cause errors
  • Thinking ALB forwards to multiple target groups simultaneously
  • Confusing host header with path-based routing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes