{"action":"created","issue":{"url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/22","labels_url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/22/comments","events_url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/22/events","html_url":"https://github.com/experimental-platform/platform-configure-script/issues/22","id":100975623,"number":22,"title":"Sinatra (and probably other Rack apps) do not properly generate links","user":{"login":"halfbyte","id":299,"avatar_url":"https://avatars.githubusercontent.com/u/299?v=3","gravatar_id":"","url":"https://api.github.com/users/halfbyte","html_url":"https://github.com/halfbyte","followers_url":"https://api.github.com/users/halfbyte/followers","following_url":"https://api.github.com/users/halfbyte/following{/other_user}","gists_url":"https://api.github.com/users/halfbyte/gists{/gist_id}","starred_url":"https://api.github.com/users/halfbyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfbyte/subscriptions","organizations_url":"https://api.github.com/users/halfbyte/orgs","repos_url":"https://api.github.com/users/halfbyte/repos","events_url":"https://api.github.com/users/halfbyte/events{/privacy}","received_events_url":"https://api.github.com/users/halfbyte/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/experimental-platform/platform-configure-script/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"tiff","id":37363,"avatar_url":"https://avatars.githubusercontent.com/u/37363?v=3","gravatar_id":"","url":"https://api.github.com/users/tiff","html_url":"https://github.com/tiff","followers_url":"https://api.github.com/users/tiff/followers","following_url":"https://api.github.com/users/tiff/following{/other_user}","gists_url":"https://api.github.com/users/tiff/gists{/gist_id}","starred_url":"https://api.github.com/users/tiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiff/subscriptions","organizations_url":"https://api.github.com/users/tiff/orgs","repos_url":"https://api.github.com/users/tiff/repos","events_url":"https://api.github.com/users/tiff/events{/privacy}","received_events_url":"https://api.github.com/users/tiff/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/experimental-platform/platform-configure-script/milestones/3","html_url":"https://github.com/experimental-platform/platform-configure-script/milestones/2015-09-03","labels_url":"https://api.github.com/repos/experimental-platform/platform-configure-script/milestones/3/labels","id":1243472,"number":3,"title":"2015-09-03","description":"","creator":{"login":"tiff","id":37363,"avatar_url":"https://avatars.githubusercontent.com/u/37363?v=3","gravatar_id":"","url":"https://api.github.com/users/tiff","html_url":"https://github.com/tiff","followers_url":"https://api.github.com/users/tiff/followers","following_url":"https://api.github.com/users/tiff/following{/other_user}","gists_url":"https://api.github.com/users/tiff/gists{/gist_id}","starred_url":"https://api.github.com/users/tiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiff/subscriptions","organizations_url":"https://api.github.com/users/tiff/orgs","repos_url":"https://api.github.com/users/tiff/repos","events_url":"https://api.github.com/users/tiff/events{/privacy}","received_events_url":"https://api.github.com/users/tiff/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2015-08-06T08:21:53Z","updated_at":"2015-08-27T10:38:49Z","due_on":"2015-09-02T22:00:00Z","closed_at":null},"comments":4,"created_at":"2015-08-14T09:40:36Z","updated_at":"2015-08-27T11:18:45Z","closed_at":null,"body":"I'll create a simple test case, but for now, here's the info I gathered:\r\n\r\nWhen nginx proxies the request to the rack app, the sub folder path information gets lost and if you use to/url to generate proper url's you'll always end up with urls that are constructed from the root. \r\n\r\nLet's say I created an app \"example\", and it runs at `foo.local/example`. Every url constructed with url() or to() in sinatra ends up being wrongly constructed, for example `url('/foo')` returns `/foo` instead of `/example/foo`. \r\n\r\nI have not completely understood the underlying problem, as sinatra claims to support reverse proxying and sub folders. One issue seems to be that `SCRIPT_NAME` is empty, maybe adding that to the proxy headers could help.\r\n\r\nAs sinatra is a good fit for quick hacks, I consider this a problem :)\r\n\r\nI'll update this issue as I gather more information."},"comment":{"url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/comments/135391379","html_url":"https://github.com/experimental-platform/platform-configure-script/issues/22#issuecomment-135391379","issue_url":"https://api.github.com/repos/experimental-platform/platform-configure-script/issues/22","id":135391379,"user":{"login":"tiff","id":37363,"avatar_url":"https://avatars.githubusercontent.com/u/37363?v=3","gravatar_id":"","url":"https://api.github.com/users/tiff","html_url":"https://github.com/tiff","followers_url":"https://api.github.com/users/tiff/followers","following_url":"https://api.github.com/users/tiff/following{/other_user}","gists_url":"https://api.github.com/users/tiff/gists{/gist_id}","starred_url":"https://api.github.com/users/tiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiff/subscriptions","organizations_url":"https://api.github.com/users/tiff/orgs","repos_url":"https://api.github.com/users/tiff/repos","events_url":"https://api.github.com/users/tiff/events{/privacy}","received_events_url":"https://api.github.com/users/tiff/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T11:18:44Z","updated_at":"2015-08-27T11:18:44Z","body":"@halfbyte https://github.com/experimental-platform/platform-dokku/pull/13 this should fix the ``X_FORWARDED_PROTO`` issue. Would this also be the place to put the ``SCRIPT_NAME`` or shouldn't this rather be an environment variable?"}}