We are trying to implement path-based routing using Istio virtual service. Our application is react based SPA and it expects “/” instead of the path. We want to have a single host and we pass the app name as a parameter along with the URL and expect to reach the applications like https://digital.example.com/app1 and https://digital.example.com/app2 we tried to define “/app1 or /app2” in virtual service as a routing rule instead of “/”, but SPA is not getting loaded and we are getting 404.
and tried the below configuration.
http:
- match:
- uri:
prefix: /
route:
- destination:
host: app1
port:
number: 80
Reference used: Istio Ingress routing fails with 404 for Nginx/Angular app
This is working for app1 and tried the same rule for app2.and it is not working, getting a blank page. / should be routed to Frontend to get the Index.html.how do we handle this issue? Any help is much appreciated.