Bird
0
0

Why does this URL map configuration fail to route requests correctly?

medium📝 Debug Q7 of 15
GCP - Cloud Load Balancing
Why does this URL map configuration fail to route requests correctly?

{
"hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}],
"pathMatchers": [{"name": "pm2", "defaultService": "backend-default"}]
}

Requests to example.com are not routed as expected.
AThe path matcher name in hostRules does not match any pathMatcher name
BMissing defaultService in hostRules
CHosts array should be empty for default routing
DBackend service names must start with 'bs-'
Step-by-Step Solution
Solution:
  1. Step 1: Compare hostRules and pathMatchers names

    Host rule uses pathMatcher 'pm1', but pathMatchers define 'pm2'. This mismatch causes routing failure.
  2. Step 2: Check other fields

    defaultService is present in pathMatcher, hosts array is valid, and backend service naming is flexible.
  3. Final Answer:

    The path matcher name in hostRules does not match any pathMatcher name -> Option A
  4. Quick Check:

    Matching names between hostRules and pathMatchers is required [OK]
Quick Trick: HostRules pathMatcher must match pathMatchers name [OK]
Common Mistakes:
  • Mismatched path matcher names
  • Expecting defaultService in hostRules
  • Assuming backend names need prefixes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes