Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Automatic redirection to static error site if web server is unavailable

I was reading an article about warm recoverable web server with Compute Engine and Cloud Storage.

Normal scenario:

9z7e9

Failover:

GaGBo

Documentation states that:

In an outage, you update the external HTTP(S) Load Balancing configuration and fail over to a static site in Cloud Storage.

Can the change of external HTTP(S) Load Balancing configuration occur automatically based on some health checks? For example, if load balancer detects that website deployed on compute engine stopped responding, it automatically redirects the traffic to static site in Cloud Storage. Once web server starts working again, load balancer automatically redirects requests back to it. How can I achieve this?

2 REPLIES 2

Hi @aleksvujic ,

We can use TCP load balancing to set up a pair of backend instance groups, with one of them designated as the failover target, as described in https://cloud.google.com/load-balancing/docs/network/networklb-setting-up-failover.
For a "mixed backends" topology (i.e., instance groups backend + GCS bucket backend), we can configure path-based routing. But I'm not sure whether/how the GCS bucket can be configured as a failover target.

Thank you for the answer, but we are not interested in TCP load balancing. We need to route the requests to correct backend service based on URL address.