I am trying to write an Istio virtual service that routes the Jupyter notebook pods to a certain prefix.
Inside my virtual service I have:
spec:
gateways:
- istio-1/ingress-gateway-1
hosts:
- my.domain.com
http:
- match:
- uri:
prefix: /my-custom-prefix/
rewrite:
uri: /
route:
- destination:
host: my-jupyter-notbook-service
port:
number: 8888
When I go to my.domain.com/my-custom-prefix/lab
- I can see that the page returns a status 200.
However, the page does not complete loading, as the static file are rewritten to /. So inside the network tab I can see that static files at my.domain.com/static/lab/...
throw a 404 error. However, if I manually go my.domain.com/my-custom-prefix/static/lab/...
I can see that the file is loaded successfully.
If I remove the rewrite policy then the react files fail to load and other static file are not loaded - how can I resolve this issue?