Hi,
I am new to traefik and trying to use it in k8s. We have to use traefik as kubernetesIngress and cannot use the IngressRoute.
Problem Statement:
Whenever a request path comes as "/abc" I want the path to become "/xyz/Ping".
-
I have the following middlewae setting in the dynamic config file.
test-replacepathregex:
replacePathRegex:
regex: "/abc"
replacement: "/xyz/Ping" -
The Ingress object has the annotation
traefik.ingress.kubernetes.io/router.middlewares: test-replacepathregex@file
-
If I make direct call to /xyz/Ping it works, so I know my backend is good.
-
Now when I make request with /abc, I immediately get a 404 from traefik. Access log shows that traefik is returning the 404 and not sending /xyz/Ping to the backend.
Am I missing some configurations? Any help is appreciated.
Note: I want to use regex as my real life problem is more complicated and will need regex, here I am posting a simpler version of my problem.
Thanks,
PB