Istio - 使用 URI 正则表达式匹配重写 URI

Istio - URI Rewrite with URI Regex Match

对 Istio 比较陌生,有一个关于 Istio 的问题。假设我想根据路径重写一个 URI,但在重写中使用原始 uri 的一部分,这是我可以用 Regex 做的事情吗?我正在想象这样的事情

http:
  - match:
    - uri:
       regex: ^/(.*\s*)?(canary)(.*)?$
    rewrite:
      prefix: "/"

其中 $1 将是 uri 正则表达式中的匹配组。这样的事情可能吗?

仅那些包含 StringMatch type of values can work with regex. For example HTTPMatchRequest.

的规则

不幸的是 NOT HTTPRewrite,它只需要 strings 作为值