Is there a way to make a kubernetes service available under multiple paths via traefik ingress, but sending requests to the backend only with one path?
e.g. https://example.com/mainpath/api
and https://example.com/otherpath/api
should both send requests with /mainpath/api
to the backend
Sure, use two different ingresses, one relatively normal, the other with the traefik.ingress.kubernetes.io/rewrite-target: /mainpath/api
annotation. Your backend will have to check the X-Replaced-Path
header if it cares to be able to tell the difference.