I'm trying to create a load balancer on Google Cloud to serve content from two different buckets:
Main bucket: An App Spot bucket that hosts my main web app.
Secondary bucket: Contains static image files.
When I try to configure the backend services or URL map, it's asking for both a host and a path, and both fields are required. However, I’m not sure what to put in the host field.
I have custom domains but what are the values that I should use in this case ?
To configure routing, you may need to set up host rules and path matchers, which are configuration components of an external Application Load Balancer's URL map.
You can use your custom domains in the host field and combine both host and path rules to route traffic.
For example Consider as follows
www.example.com
for your main web app and static.example.com
for your static image bucket www.example.com/\*
for web app and static.example.com/images/\*
for your static image bucket.
If you want to direct requests to different path matchers, you must use different host rules. Two host rules in a URL map can't include the same hostname. It is possible to match all hostnames by specifying the wildcard character * in the host rule.
Refer to this document on Set up a classic Application Load Balancer with Cloud Storage buckets more information.