Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traefik.ingress.kubernetes.io/rewrite-target didn't work as expected in k8s #3566

Closed
niexiongfang opened this issue Jul 6, 2018 · 1 comment
Assignees
Labels
area/provider/k8s/ingress kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Milestone

Comments

@niexiongfang
Copy link

niexiongfang commented Jul 6, 2018

actually reopen #3494 for my case the rewrite-target was not the root ('/'), which cannot be workaround by PathPrefixStrip

Do you want to request a feature or report a bug?

Bug

What did you do?

I try to replace nginx-ingress with traefik-ingress on k8s. And I find that rewrite-target has a strange behavior.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/rewrite-target: /demo
  name: traefik-test
spec:
  rules:
  - host: <traefik-domain>
    http:
      paths:
      - backend:
          serviceName: tomcat-service
          servicePort: 8080
        path: /qwe/asd
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /demo
  name: nginx-test
spec:
  rules:
  - host: <nginx-domain>
    http:
      paths:
      - backend:
          serviceName: tomcat-service
          servicePort: 8080
        path: /qwe/asd
send request
http://<traefik-domain>/qwe/asd/api?token=12345
http://<nginx-domain>/qwe/asd/api?token=12345

What did you expect to see?

nginx:
backend recieve "GET /demo/api?token=12345 HTTP/1.1"

What did you see instead?

traefik:
backend recieve "GET /demo HTTP/1.1"

Output of traefik version: (What version of Traefik are you using?)

traefik:1.6.3
nginx-ingress-controller:0.15.0
@geraldcroes geraldcroes added area/provider/k8s/ingress kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. labels Jul 6, 2018
@geraldcroes geraldcroes added priority/P1 need to be fixed in next release and removed status/0-needs-triage labels Jul 6, 2018
@traefiker
Copy link
Contributor

Closed by #3582.

@traefiker traefiker added this to the 1.7 milestone Jul 9, 2018
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/provider/k8s/ingress kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

4 participants