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

Specify URL instead of IP:port in network endpoints for applications behind reverse proxy

We are using GCP external HTTPS load balancer, architecture is shown in the diagram below. The primary use of LB is redirecting users to static error site (hosted on Cloud Storage bucket) in case CE instance is down, Traefik crashes on CE, Docker crashes on CE, etc.

We have 4 backend services defined on load balancer:

  1. static-error-page backend bucket
  2. blog-backend-service, gallery-backend-service and shop-backend-service zonal network endpoint groups

Then, we defined host and path rules so that:

  1. https://blog.company.com -> blog-backend-service
  2. https://gallery.company.com -> gallery-backend-service
  3. https://shop.company.com -> shop-backend-service
  4. All unmatched (default) -> static-error-page

Each zonal network endpoint group (blog-backend-service, gallery-backend-service and shop-backend-service) has just 1 endpoint defined: 192.168.171:443 (192.168.171.3 is internal IP of CE instance).

However, since my websites are served behind reverse proxy (Traefik), specifying IP:port combination in network endpoint is useless because they all have the same IP:port. I would like to specify URL instead of IP:port in network endpoint (that way network endpoint would also show correct health status if website is down, it always reports healthy now, even if application is down).

Is it possible to specify URL instead of IP:port in network endpoint? If not, what are my alternatives?

(click on the image to enlarge it)

z9FMb