Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Istio - URI Rewrite with URI Regex Match

Tags:

istio

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?

like image 217
DominicEU Avatar asked Jun 06 '19 11:06

DominicEU


Video Answer


1 Answers

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

like image 136
A_Suh Avatar answered Oct 02 '22 09:10

A_Suh