Consider a URL map configured with two host rules: one for example.com routing to backend service A, and another for test.com routing to backend service B. What happens when a request is sent to example.com?
Think about how host rules match the domain name in the request.
URL maps use host rules to match the domain name in the incoming request. If the host matches example.com, the request is routed to the backend service assigned to that host rule.
A URL map has a path matcher that routes requests with path /images/* to backend service Images, and all other paths to backend service Default. What backend service handles a request to /images/logo.png?
Consider how path matchers use wildcard patterns.
Path matchers use wildcard patterns to match request paths. The pattern /images/* matches any path starting with /images/, so /images/logo.png matches and routes to backend service Images.
You want to route users to backend services in different regions based on URL path prefixes: /us/* to US backend, /eu/* to EU backend, and all others to a global backend. Which URL map configuration achieves this?
Think about how path matchers can route based on URL paths.
URL maps can use path matchers with wildcard paths to route requests to different backends based on URL prefixes. This allows routing /us/* to US backend, /eu/* to EU backend, and all others to a global backend.
A URL map is created with host and path rules but no default backend service. What is the expected behavior when a request does not match any host or path rule?
Consider what happens when no matching rule exists and no default is set.
If no default backend service is configured, and the request does not match any host or path rule, the load balancer returns a 404 Not Found error because it does not know where to send the request.
You manage a global HTTP(S) load balancer with multiple backend services worldwide. Which URL map design best reduces latency for users worldwide?
Think about combining routing and caching to improve latency.
Routing users to the nearest backend service using host and path rules reduces latency. Adding Cloud CDN caches content closer to users, further improving response times.