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:- port: 443
headers:
appversion:
exact:
rewrite:
uri: “/$appversion/”
route: - destination:
port:
number: 8080
host: s3-website-eu-west-1.amazonaws.com
- port: 443
Is there a way to access the HTTP headers as variables?
Regards,
Jasper Misset