问题
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