I have one ingress handling traffic for 2 different services:
rules:
- http:
paths:
- path: /stats
backend:
serviceName: info-dashboard
servicePort: 80
- path: /*
backend:
serviceName: portal
servicePort: 80
I also have URL rewrite rules for the info-dashboard. Rewrite /stats -> / when the traffic is sent to the service. Because the app behind the backend service expects its endpoint hits to start with /, not /stats.
So, the issue is that hitting /stats on the LB is fine, but subsequent calls fail (eg. automated app calls to fetch javascript and other logic). They fail because they try to load from /, which is a different app.
The app is a Next.js app. So, I also tried setting up a basePath. But the issue persists.
Actually, if I remove the /stats -> / redirect rule from the LB, any hits to /stats just direct me to the other app on the ingress - the portal. I'm confused why and how this works.
Am I missing something in the setup?