0

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_url_map#example-usage---url-map-header-based-routing

route_rules {
  priority = 1
  service = google_compute_backend_service.service-a.id
  match_rules {
    prefix_match = "/"
    ignore_case = true
    header_matches {
      header_name = "abtest"
      exact_match = "a"
    }
  }

Probably this is closest to what i need. But as part of priority 1 rule, i need to check that header contains minimum 2 headers, request.scheme is https and request is from a predefined IP.

How to implement such rule?

Can Common Expression Language (CEL) be used here? something like:

has(request.headers['referer']) && request.headers['referer'] != ""
dotnetavalanche
  • 804
  • 2
  • 12
  • 25

1 Answers1

1

For sure, Custom headers could be created on GCP HTTPS Load Balancer, and you are able to use Common Expression Language (CEL).

Just take a look about the Limitations.

blueboy1115
  • 161
  • 2
  • I'm happy to know the answer was useful, in order to help the community in the future, could you please accept or upvote the answer? Thanks – blueboy1115 Feb 16 '21 at 16:30