Bird
0
0

How can you configure a URL map to route requests differently based on both host and path, for example, sending https://blog.example.com/news to backend-blog-news and https://shop.example.com/news to backend-shop-news?

hard📝 Application Q9 of 15
GCP - Cloud Load Balancing
How can you configure a URL map to route requests differently based on both host and path, for example, sending https://blog.example.com/news to backend-blog-news and https://shop.example.com/news to backend-shop-news?
AUse firewall rules to differentiate traffic by host
BUse one host rule with both hosts and a single path matcher routing '/news' to both backends
CCreate two host rules for 'blog.example.com' and 'shop.example.com', each with a path matcher routing '/news' to the respective backend
DCreate one path matcher with multiple hosts and route '/news' to a shared backend
Step-by-Step Solution
Solution:
  1. Step 1: Use separate host rules for each domain

    Each host needs its own host rule to route traffic independently.
  2. Step 2: Assign path matchers per host rule

    Each host rule points to a path matcher that routes '/news' to the correct backend service.
  3. Final Answer:

    Create two host rules for 'blog.example.com' and 'shop.example.com', each with a path matcher routing '/news' to the respective backend -> Option C
  4. Quick Check:

    Separate host rules for different domains [OK]
Quick Trick: Use separate host rules for different hosts [OK]
Common Mistakes:
  • Combining hosts in one rule incorrectly
  • Routing same path to multiple backends
  • Using firewall rules for routing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes