{"action":"created","issue":{"url":"https://api.github.com/repos/containous/traefik/issues/3741","repository_url":"https://api.github.com/repos/containous/traefik","labels_url":"https://api.github.com/repos/containous/traefik/issues/3741/labels{/name}","comments_url":"https://api.github.com/repos/containous/traefik/issues/3741/comments","events_url":"https://api.github.com/repos/containous/traefik/issues/3741/events","html_url":"https://github.com/containous/traefik/issues/3741","id":348084503,"node_id":"MDU6SXNzdWUzNDgwODQ1MDM=","number":3741,"title":"Wrong behaviour of HTTP -> HTTPS redirect with request-modifier (ReplacePathRegex)","user":{"login":"kachkaev","id":608862,"node_id":"MDQ6VXNlcjYwODg2Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/608862?v=4","gravatar_id":"","url":"https://api.github.com/users/kachkaev","html_url":"https://github.com/kachkaev","followers_url":"https://api.github.com/users/kachkaev/followers","following_url":"https://api.github.com/users/kachkaev/following{/other_user}","gists_url":"https://api.github.com/users/kachkaev/gists{/gist_id}","starred_url":"https://api.github.com/users/kachkaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kachkaev/subscriptions","organizations_url":"https://api.github.com/users/kachkaev/orgs","repos_url":"https://api.github.com/users/kachkaev/repos","events_url":"https://api.github.com/users/kachkaev/events{/privacy}","received_events_url":"https://api.github.com/users/kachkaev/received_events","type":"User","site_admin":false},"labels":[{"id":410567211,"node_id":"MDU6TGFiZWw0MTA1NjcyMTE=","url":"https://api.github.com/repos/containous/traefik/labels/area/provider/k8s","name":"area/provider/k8s","color":"d4c5f9","default":false},{"id":591455072,"node_id":"MDU6TGFiZWw1OTE0NTUwNzI=","url":"https://api.github.com/repos/containous/traefik/labels/kind/bug/confirmed","name":"kind/bug/confirmed","color":"ee0701","default":false},{"id":488615524,"node_id":"MDU6TGFiZWw0ODg2MTU1MjQ=","url":"https://api.github.com/repos/containous/traefik/labels/priority/P2","name":"priority/P2","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":{"login":"dtomcej","id":6989327,"node_id":"MDQ6VXNlcjY5ODkzMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/6989327?v=4","gravatar_id":"","url":"https://api.github.com/users/dtomcej","html_url":"https://github.com/dtomcej","followers_url":"https://api.github.com/users/dtomcej/followers","following_url":"https://api.github.com/users/dtomcej/following{/other_user}","gists_url":"https://api.github.com/users/dtomcej/gists{/gist_id}","starred_url":"https://api.github.com/users/dtomcej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtomcej/subscriptions","organizations_url":"https://api.github.com/users/dtomcej/orgs","repos_url":"https://api.github.com/users/dtomcej/repos","events_url":"https://api.github.com/users/dtomcej/events{/privacy}","received_events_url":"https://api.github.com/users/dtomcej/received_events","type":"User","site_admin":false},"assignees":[{"login":"dtomcej","id":6989327,"node_id":"MDQ6VXNlcjY5ODkzMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/6989327?v=4","gravatar_id":"","url":"https://api.github.com/users/dtomcej","html_url":"https://github.com/dtomcej","followers_url":"https://api.github.com/users/dtomcej/followers","following_url":"https://api.github.com/users/dtomcej/following{/other_user}","gists_url":"https://api.github.com/users/dtomcej/gists{/gist_id}","starred_url":"https://api.github.com/users/dtomcej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtomcej/subscriptions","organizations_url":"https://api.github.com/users/dtomcej/orgs","repos_url":"https://api.github.com/users/dtomcej/repos","events_url":"https://api.github.com/users/dtomcej/events{/privacy}","received_events_url":"https://api.github.com/users/dtomcej/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/containous/traefik/milestones/9","html_url":"https://github.com/containous/traefik/milestone/9","labels_url":"https://api.github.com/repos/containous/traefik/milestones/9/labels","id":3212132,"node_id":"MDk6TWlsZXN0b25lMzIxMjEzMg==","number":9,"title":"1.7","description":"","creator":{"login":"ldez","id":5674651,"node_id":"MDQ6VXNlcjU2NzQ2NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/5674651?v=4","gravatar_id":"","url":"https://api.github.com/users/ldez","html_url":"https://github.com/ldez","followers_url":"https://api.github.com/users/ldez/followers","following_url":"https://api.github.com/users/ldez/following{/other_user}","gists_url":"https://api.github.com/users/ldez/gists{/gist_id}","starred_url":"https://api.github.com/users/ldez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldez/subscriptions","organizations_url":"https://api.github.com/users/ldez/orgs","repos_url":"https://api.github.com/users/ldez/repos","events_url":"https://api.github.com/users/ldez/events{/privacy}","received_events_url":"https://api.github.com/users/ldez/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":201,"state":"open","created_at":"2018-03-23T12:54:13Z","updated_at":"2018-08-14T16:38:06Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-08-06T21:14:55Z","updated_at":"2018-08-14T16:38:06Z","closed_at":"2018-08-14T16:38:06Z","author_association":"CONTRIBUTOR","body":"<!--\r\nDO NOT FILE ISSUES FOR GENERAL SUPPORT QUESTIONS.\r\n\r\nThe issue tracker is for reporting bugs and feature requests only.\r\nFor end-user related support questions, please refer to one of the following:\r\n\r\n- Stack Overflow (using the \"traefik\" tag): https://stackoverflow.com/questions/tagged/traefik\r\n- the Traefik community Slack channel: https://slack.traefik.io\r\n\r\n-->\r\n\r\n\r\n### Do you want to request a *feature* or report a *bug*?\r\n\r\nBug\r\n\r\n### What did you do?\r\n\r\n<!--\r\n\r\nHOW TO WRITE A GOOD BUG REPORT?\r\n\r\n- Respect the issue template as much as possible.\r\n- If possible, use the command `traefik bug`. See https://www.youtube.com/watch?v=Lyz62L8m93I.\r\n- The title should be short and descriptive.\r\n- Explain the conditions which led you to report this issue: the context.\r\n- The context should lead to something, an idea or a problem that you’re facing.\r\n- Remain clear and concise.\r\n- Format your messages to help the reader focus on what matters and understand the structure of your message, use Markdown syntax https://help.github.com/articles/github-flavored-markdown\r\n\r\n-->\r\n\r\nThere's been a long-standing issue with preserving paths when redirecting from HTTP to HTTPS (https://github.com/containous/traefik/issues/1957), but it was finally fixed in https://github.com/containous/traefik/pull/3631 by @dtomcej. This is great stuff and I can confirm that `PathPrefixStrip` works properly in `1.7.3-rc3` 🎉 \r\n\r\nHowever, it looks like the problem is still out there when we use `ReplacePathRegex`.\r\n\r\nHere's an ingress annotation that works correctly:\r\n\r\n```yaml\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: example-ingress\r\n  annotations:\r\n    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip\r\nspec:\r\n  rules:\r\n  - host: example.com\r\n    http:\r\n      paths:\r\n      - path: /backend-path\r\n        backend:\r\n          serviceName: example-backend\r\n          servicePort: http\r\n```\r\n\r\n```bash\r\nhttp http://example.com/backend-path/abc\r\n# HTTP/1.1 302 Found\r\n# Content-Length: 5\r\n# Content-Type: text/plain; charset=utf-8\r\n# Date: Mon, 06 Aug 2018 20:55:37 GMT\r\n# Location: https://example.com/backend-path/abc\r\n# \r\n# Found\r\n```\r\n\r\nAnd here's the same rule idea, but implemented via `request-modifier` / `ReplacePathRegex`:\r\n\r\n```yaml\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: example-ingress\r\n  annotations:\r\n    traefik.ingress.kubernetes.io/request-modifier: \"ReplacePathRegex: ^/backend-path-2/(.*) /$1\"\r\nspec:\r\n  rules:\r\n  - host: example.com\r\n    http:\r\n      paths:\r\n      - path: /backend-path-2\r\n        backend:\r\n          serviceName: example-backend\r\n          servicePort: http\r\n```\r\n\r\n```bash\r\nhttp http://example.com/backend-path-2/abc\r\n# HTTP/1.1 302 Found\r\n# Content-Length: 5\r\n# Content-Type: text/plain; charset=utf-8\r\n# Date: Mon, 06 Aug 2018 20:55:40 GMT\r\n# Location: https://example.com/abc\r\n# \r\n# Found\r\n```\r\n\r\n\r\n### What did you expect to see?\r\n\r\nI expected `\"ReplacePathRegex: ^/backend-path-2/(.*) /$1\"` work just like `PathPrefixStrip`, but it acted as before https://github.com/containous/traefik/pull/3631.\r\n\r\n### Output of `traefik version`: (_What version of Traefik are you using?_)\r\n\r\n<!--\r\nFor the Traefik Docker image:\r\n    docker run [IMAGE] version\r\n    ex: docker run traefik version\r\n\r\nFor the alpine Traefik Docker image:\r\n    docker run [IMAGE] traefik version\r\n    ex: docker run traefik traefik version\r\n-->\r\n\r\n```\r\nofficial helm chart, traefik image tag: `1.7.0-rc3-alpine`\r\n```\r\n\r\n---\r\n**PS**: I switched to `ReplacePathRegexp` in an attempt to configure both path prefix stripping and adding trailing slash in one ingress rule (see [my stackoveflow question](https://stackoverflow.com/questions/51697574/adding-trailing-slash-to-microservice-root-path-in-traefik-ingress)). Not sure if it's the best solution though, regardless of this issue with HTTP → HTTPS redirects."},"comment":{"url":"https://api.github.com/repos/containous/traefik/issues/comments/412936329","html_url":"https://github.com/containous/traefik/issues/3741#issuecomment-412936329","issue_url":"https://api.github.com/repos/containous/traefik/issues/3741","id":412936329,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjkzNjMyOQ==","user":{"login":"traefiker","id":30906710,"node_id":"MDQ6VXNlcjMwOTA2NzEw","avatar_url":"https://avatars2.githubusercontent.com/u/30906710?v=4","gravatar_id":"","url":"https://api.github.com/users/traefiker","html_url":"https://github.com/traefiker","followers_url":"https://api.github.com/users/traefiker/followers","following_url":"https://api.github.com/users/traefiker/following{/other_user}","gists_url":"https://api.github.com/users/traefiker/gists{/gist_id}","starred_url":"https://api.github.com/users/traefiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traefiker/subscriptions","organizations_url":"https://api.github.com/users/traefiker/orgs","repos_url":"https://api.github.com/users/traefiker/repos","events_url":"https://api.github.com/users/traefiker/events{/privacy}","received_events_url":"https://api.github.com/users/traefiker/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T16:38:06Z","updated_at":"2018-08-14T16:38:06Z","author_association":"NONE","body":"Closed by #3742."}}
{"actor":{"display_login":"traefiker"}}