Traefik on Kubernetes does not keep path over redirect
The issue here is that PathPrefixStrip
removes /config-server
and it initially forwards the request to your backend with just /
. However, when your backend redirects it's a new request and the Ingress doesn't understand the request to /
or /login
. You could create two Ingress(es) for each backend and use single backend in each with a path to /
. But this would mean adding a new ingress-class and the good news is that Traefik
supports it. You could also try an nginx ingress which has the --ingress-class
option.
You can find more information on how to create multiple ingress controllers here
If you want a single Ingress it will also be tricky since you might have to add logic in your app to understand the /config-server
path for example.