Bird
0
0

How should you configure the URL map?

hard📝 Application Q8 of 15
GCP - Cloud Load Balancing
You want to route traffic to different backend services based on URL path prefixes: /api/* to backend-api, /static/* to backend-static, and all other paths to backend-default. How should you configure the URL map?
ACreate pathMatchers with pathRules for /api/* and /static/* pointing to respective backends, and set defaultService to backend-default.
BSet defaultService to backend-api and create hostRules for /static/* and /default/*.
CUse multiple URL maps, one for each backend service.
DConfigure backend services to handle routing internally without URL map changes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand URL map routing by path

    URL maps use pathMatchers with pathRules to route based on URL prefixes, with a defaultService for unmatched paths.
  2. Step 2: Apply correct configuration

    Create pathMatchers with pathRules for /api/* and /static/* pointing to respective backends, and set defaultService to backend-default. correctly uses pathMatchers with pathRules for /api/* and /static/*, and defaultService for others. Other options misuse hostRules, multiple URL maps, or backend internal routing.
  3. Final Answer:

    Create pathMatchers with pathRules for /api/* and /static/* pointing to respective backends, and set defaultService to backend-default. -> Option A
  4. Quick Check:

    Path-based routing uses pathMatchers and defaultService [OK]
Quick Trick: Use pathMatchers and defaultService for path routing [OK]
Common Mistakes:
  • Misusing hostRules for path routing
  • Trying multiple URL maps instead of one
  • Relying on backend services for routing instead of load balancer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes