{"action":"created","issue":{"url":"https://api.github.com/repos/eBay/fabio/issues/44","repository_url":"https://api.github.com/repos/eBay/fabio","labels_url":"https://api.github.com/repos/eBay/fabio/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/eBay/fabio/issues/44/comments","events_url":"https://api.github.com/repos/eBay/fabio/issues/44/events","html_url":"https://github.com/eBay/fabio/issues/44","id":130964437,"number":44,"title":"Strip prefix in the forwarded request","user":{"login":"jeanblanchard","id":760414,"avatar_url":"https://avatars.githubusercontent.com/u/760414?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanblanchard","html_url":"https://github.com/jeanblanchard","followers_url":"https://api.github.com/users/jeanblanchard/followers","following_url":"https://api.github.com/users/jeanblanchard/following{/other_user}","gists_url":"https://api.github.com/users/jeanblanchard/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanblanchard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanblanchard/subscriptions","organizations_url":"https://api.github.com/users/jeanblanchard/orgs","repos_url":"https://api.github.com/users/jeanblanchard/repos","events_url":"https://api.github.com/users/jeanblanchard/events{/privacy}","received_events_url":"https://api.github.com/users/jeanblanchard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eBay/fabio/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-03T09:20:59Z","updated_at":"2016-02-19T11:36:27Z","closed_at":"2016-02-03T09:36:48Z","body":"Scenario: \r\n* I have fabio set up to listen to `http://fabioserver/`\r\n* I have a route configured for a service, with prefix `/myservice`\r\n\r\nWhen making a request to `http://fabioserver/myservice/index.html`, the service currently receives the forwarded request from fabio to `/myservice/index.html`\r\nI would like to have the option to strip the prefix in fabio, so that the service would receive a request to `/index.html`\r\n\r\nI currently have a homemade go proxy that does that, using `http.StripPrefix`. I may have the time to prepare a PR for this at some point, but no promises..."},"comment":{"url":"https://api.github.com/repos/eBay/fabio/issues/comments/186181762","html_url":"https://github.com/eBay/fabio/issues/44#issuecomment-186181762","issue_url":"https://api.github.com/repos/eBay/fabio/issues/44","id":186181762,"user":{"login":"jeanblanchard","id":760414,"avatar_url":"https://avatars.githubusercontent.com/u/760414?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanblanchard","html_url":"https://github.com/jeanblanchard","followers_url":"https://api.github.com/users/jeanblanchard/followers","following_url":"https://api.github.com/users/jeanblanchard/following{/other_user}","gists_url":"https://api.github.com/users/jeanblanchard/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanblanchard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanblanchard/subscriptions","organizations_url":"https://api.github.com/users/jeanblanchard/orgs","repos_url":"https://api.github.com/users/jeanblanchard/repos","events_url":"https://api.github.com/users/jeanblanchard/events{/privacy}","received_events_url":"https://api.github.com/users/jeanblanchard/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T11:36:27Z","updated_at":"2016-02-19T11:36:27Z","body":"... And I'm back...\r\n\r\nIt turns out I really need this after all. I tried to make all services have their prefix configurable, but this introduces a bit of complexity everywhere in the service, which I really want to avoid.\r\nI think you'll agree that the services should not depend on the host where they are deployed. I believe the same is true for the path.\r\nStripping the prefix would allow services to work the same, regardless of the path where they are deployed.\r\n\r\nNote that I do not suggest rewriting the urls in the responses (or maybe just Location headers), but instead encourage services to use relative urls.\r\n\r\nAnyway, would you accept a pull request to add this option, or should I maintain my own fork ?"}}