I have one website and one api server on different instances:
- Is it possible to serve both of them through the same HTTP load balancer?
- Is there a down side to doing this vs. 2 load balancers?
I went over these:
It is possible to serve both of them from the same HTTP load balancer (LB) by creating
The URL map can be configured from Developers Console or by using gcloud command as describe in step 7 of "Send traffic to your instances" section at Google Content-Based Load Balancing example. Every time an HTTP request arrives to your LB, it will check its URL map and dispatch it to the right backend.
Apart from duplicated configuration and number of external IPs, the difference between using one or two LBs is pricing as describe in "Load Balancing and Protocol Forwarding" section here. You can use the Google Cloud Platform Pricing Calculator to see how much would you pay depending on the number of LBs.
Hope it helps.