Istio - URI Rewrite with URI Regex Match

两盒软妹~` 提交于 2020-02-25 03:23:14

问题


So relatively new to Istio and have a question regarding Istio. Say that I want to rewrite a URI based on a path, but use part of that original uri in the rewrite, is that something I could do with Regex? I'm imagining something like this

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

Where $1 would be a matching group on the uri regex. Is something like that possible?


回答1:


Only those rule, which contain StringMatch type of values can work with regex. For example HTTPMatchRequest.

Unfortunately NOT HTTPRewrite, which takes only strings as a value



来源:https://stackoverflow.com/questions/56476847/istio-uri-rewrite-with-uri-regex-match

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!