0

See the image below of me trying to implement wildcard paths to route to a different backend:

enter image description here

If I enter a path such as /events/*, its allowed for routing to a different backend. But if I try to get more specific such as /events/*/upload, it does not work.

I am trying to have all media (video, images, etc) be processed on a different backend, and my route will have a UUID and look something like /events/1234-323442-f234-3-/upload. How can I route that to a different backend?

Devin Dixon
  • 11,553
  • 24
  • 86
  • 167
  • 1
    Did you notice this section? Do you use a classic HTTPS load balancer? https://cloud.google.com/load-balancing/docs/url-map-concepts#wildcards-regx-dynamic – guillaume blaquiere May 03 '23 at 19:35

1 Answers1

0

Per the documentation:

  • A path rule can only include a wildcard character () after a forward slash character (/). For example, /videos/ and /videos/hd/* are valid for path rules, but /videos* and /videos/hd* are not.
  • Path rules do not use regular expressions or substring matching. PathTemplateMatch can use simplified path matching operators. For example, path rules for either /videos/hd or /videos/hd/* do not apply to a URL with the path /video/hd-abcd. However, a path rule for /video/* does apply to that path.
  • Path matchers (and URL maps in general) do not offer features that function like Apache LocationMatch directives. If you have an application that generates dynamic URL paths that have a common prefix, such as /videos/hd-abcd and /videos/hd-pqrs, and you need to send requests made to those paths to different backend services, you might not be able to do that with a URL map. For simple cases containing only a few possible dynamic URLs, you might be able to create a path matcher with a limited set of path rules. For more complex cases, you need to do path-based regular expression matching on your backends.
James S
  • 1,181
  • 1
  • 7