{"action":"opened","issue":{"url":"https://api.github.com/repos/containous/traefik/issues/3566","repository_url":"https://api.github.com/repos/containous/traefik","labels_url":"https://api.github.com/repos/containous/traefik/issues/3566/labels{/name}","comments_url":"https://api.github.com/repos/containous/traefik/issues/3566/comments","events_url":"https://api.github.com/repos/containous/traefik/issues/3566/events","html_url":"https://github.com/containous/traefik/issues/3566","id":338801638,"node_id":"MDU6SXNzdWUzMzg4MDE2Mzg=","number":3566,"title":" traefik.ingress.kubernetes.io/rewrite-target didn't work as expected in k8s","user":{"login":"niexiongfang","id":28796753,"node_id":"MDQ6VXNlcjI4Nzk2NzUz","avatar_url":"https://avatars2.githubusercontent.com/u/28796753?v=4","gravatar_id":"","url":"https://api.github.com/users/niexiongfang","html_url":"https://github.com/niexiongfang","followers_url":"https://api.github.com/users/niexiongfang/followers","following_url":"https://api.github.com/users/niexiongfang/following{/other_user}","gists_url":"https://api.github.com/users/niexiongfang/gists{/gist_id}","starred_url":"https://api.github.com/users/niexiongfang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niexiongfang/subscriptions","organizations_url":"https://api.github.com/users/niexiongfang/orgs","repos_url":"https://api.github.com/users/niexiongfang/repos","events_url":"https://api.github.com/users/niexiongfang/events{/privacy}","received_events_url":"https://api.github.com/users/niexiongfang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-06T04:31:24Z","updated_at":"2018-07-06T04:31:24Z","closed_at":null,"author_association":"NONE","body":"actually reopen https://github.com/containous/traefik/issues/3494  for my case the rewrite-target was not the root ('/'), which cannot be workaround by PathPrefixStrip\r\n\r\nDo you want to request a feature or report a bug?\r\nBug\r\n\r\nWhat did you do?\r\nI try to replace nginx-ingress with traefik-ingress on k8s. And I find that rewrite-target has a strange behavior.\r\n\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  annotations:\r\n    kubernetes.io/ingress.class: traefik\r\n    traefik.ingress.kubernetes.io/rewrite-target: /demo\r\n  name: traefik-test\r\nspec:\r\n  rules:\r\n  - host: <traefik-domain>\r\n    http:\r\n      paths:\r\n      - backend:\r\n          serviceName: tomcat-service\r\n          servicePort: 8080\r\n        path: /qwe/asd\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  annotations:\r\n    kubernetes.io/ingress.class: nginx\r\n    nginx.ingress.kubernetes.io/rewrite-target: /demo\r\n  name: nginx-test\r\nspec:\r\n  rules:\r\n  - host: <nginx-domain>\r\n    http:\r\n      paths:\r\n      - backend:\r\n          serviceName: tomcat-service\r\n          servicePort: 8080\r\n        path: /qwe/asd\r\nsend request\r\nhttp://<traefik-domain>/qwe/asd/api?token=12345\r\nhttp://<nginx-domain>/qwe/asd/api?token=12345\r\n\r\nWhat did you expect to see?\r\nnginx:\r\nbackend recieve \"GET /demo/api?token=12345 HTTP/1.1\"\r\n\r\nWhat did you see instead?\r\ntraefik:\r\nbackend recieve \"GET /demo HTTP/1.1\"\r\n\r\nOutput of traefik version: (What version of Traefik are you using?)\r\ntraefik:1.6.3\r\nnginx-ingress-controller:0.15.0"}}
{"actor":{"display_login":"niexiongfang"}}