Regex Based Routing?

Currently I can use a regex in a uri match, for instance, but not in the following route. It would be very useful (and powerful) to be able to create a rule along the lines of the following, which I’ve adapted from my current traefik rules.

  - match:
    - uri:
        regex: /apiserver/{vhash: [0-9a-f]{40}}/gapi/
    rewrite:
      uri: /
    route:
    - destination:
        host: apiserver-${vhash}

Obviously I can write one of these by hand on a per-vhash basis, but that’s a lot of repetition of the same thing.

Unfortunately, its not supported today. This requires dynamic determination of upstream clusters in Envoy based on some custom rules. Envoy does not have the support for this as of now.

It would be great to have even a very basic version of this feature. A common requirement for static sites is to load index.html for directories (e.g. /foo/ gets rewritten as /foo/index.html). As of now, there seems to be no way to implement a simple rule like this in istio in a dynamic way. Another example would be redirecting /foo to /foo/ (with a trailing slash at the end).