Rewriting uri with value of requestheader

Hi,

In a VirtualService. is it possible to rewrite the /uri to the value of a specific requestheader?
In our setup, we would like to use a http-header with the name appversion to point to a specific directory in our backend (a s3 bucket in AWS).
So for example, a request to https://example.org/ with a http-header appversion: 1.0.0
will be send to the bucket with path /1.0.0/

So something like this:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ingress-gateway-routes
spec:
hosts:

  • example.org
    gateways:
  • http-gateway
    http:
  • name: “example”
    match:

Is there a way to access the HTTP headers as variables?

Regards,
Jasper Misset