HTTPRewrite regex rule with match group substition

Is it in any way possible to write a HTTPRewrite rule that substitutes matching groups? Like using $1 in the rewrite.uri field?

For example:

  • Match on: ^example\.com\/(.+)\/foo
  • Rewrite to: example\.com\/bar/$1
3 Likes

@cmeury do you solve this question?

No, we had to workaround it by forwarding the request to a dedicated, small application that handled the routing for us. It’s okay for us as these request are only used for old generation services that have been or will be decommissioned soon.

We have the same use case with the same workaround, I suspect envoy can do it and Istio could add the feature