I have following config in my nginx:
location / {
if ($request_uri ~* ^/checkout/(dev-dist|dist|images|js|libs|resources|angular4-hybrid|bundle.js)) {
proxy_pass http://static-qa-uscentral1.company.com/hybrid/live$request_uri;
break;
}
}
I am trying to replicate this in istio's virtual service
I have written following virtual service to match this regex:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: routes-static
namespace: mui-relqa
spec:
gateways:
- my-gateway
hosts:
- "*"
http:
- match:
- uri:
regex: '^./checkout/(dev-dist|dist|images|js|libs|resources|angular4-hybrid|bundle.js).*$'
redirect:
authority: static-qa-uscentral1.company.com
uri: /hybrid/live
Few things I would lobe to have clarity on:
how to use that $request_uri used in nginx config to replicate in virtual service
using the above virtual service it will totally redirect the calls to "static-qa-uscentral1.company.com" which I have mentioned in "authority" parameter in "virtualservice" yaml. How can I achieve what nginx does during proxy_pass which doesnot change the URL but still gets the content of redirected URL.