{"action":"created","issue":{"url":"https://api.github.com/repos/Kinto/kinto/issues/218","labels_url":"https://api.github.com/repos/Kinto/kinto/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/Kinto/kinto/issues/218/comments","events_url":"https://api.github.com/repos/Kinto/kinto/issues/218/events","html_url":"https://github.com/Kinto/kinto/issues/218","id":112095397,"number":218,"title":"Setting kinto.http_host disturbs redirections","user":{"login":"leplatrem","id":546692,"avatar_url":"https://avatars.githubusercontent.com/u/546692?v=3","gravatar_id":"","url":"https://api.github.com/users/leplatrem","html_url":"https://github.com/leplatrem","followers_url":"https://api.github.com/users/leplatrem/followers","following_url":"https://api.github.com/users/leplatrem/following{/other_user}","gists_url":"https://api.github.com/users/leplatrem/gists{/gist_id}","starred_url":"https://api.github.com/users/leplatrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leplatrem/subscriptions","organizations_url":"https://api.github.com/users/leplatrem/orgs","repos_url":"https://api.github.com/users/leplatrem/repos","events_url":"https://api.github.com/users/leplatrem/events{/privacy}","received_events_url":"https://api.github.com/users/leplatrem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Kinto/kinto/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Kinto/kinto/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/Kinto/kinto/labels/scope:%20cliquet","name":"scope: cliquet","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"leplatrem","id":546692,"avatar_url":"https://avatars.githubusercontent.com/u/546692?v=3","gravatar_id":"","url":"https://api.github.com/users/leplatrem","html_url":"https://github.com/leplatrem","followers_url":"https://api.github.com/users/leplatrem/followers","following_url":"https://api.github.com/users/leplatrem/following{/other_user}","gists_url":"https://api.github.com/users/leplatrem/gists{/gist_id}","starred_url":"https://api.github.com/users/leplatrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leplatrem/subscriptions","organizations_url":"https://api.github.com/users/leplatrem/orgs","repos_url":"https://api.github.com/users/leplatrem/repos","events_url":"https://api.github.com/users/leplatrem/events{/privacy}","received_events_url":"https://api.github.com/users/leplatrem/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-10-19T08:16:55Z","updated_at":"2015-10-19T12:27:28Z","closed_at":null,"body":"Scenario at PyconFr: \r\n\r\n- user A runs kinto on `0.0.0.0:8888` with make serve\r\n- user B tries accesses on user A instance through local Wifi `192.168.1.12:8888`\r\n- user B is redirected to `http://localhost:8888/v1`\r\n\r\nIndeed, in default configuration `kinto.http_host` is equal to `localhost:8888`. And we use this setting to force `request.host` if it is defined.\r\n\r\nWe had done that in cliquet a while ago, because otherwise the pagination  `Next-Page` URL would not contain the port.\r\n\r\nI realize this is not acceptable :) Especially because the same information is duplicated several times:\r\n\r\n* `[server:main] host = 0.0.0.0 port = 8888`\r\n* `kinto.http_host = 0.0.0.0:8888`\r\n* `[uwsgi] http-socket = 127.0.0.1:8888`"},"comment":{"url":"https://api.github.com/repos/Kinto/kinto/issues/comments/149199916","html_url":"https://github.com/Kinto/kinto/issues/218#issuecomment-149199916","issue_url":"https://api.github.com/repos/Kinto/kinto/issues/218","id":149199916,"user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T12:27:28Z","updated_at":"2015-10-19T12:27:28Z","body":"Note that this settings don't have anything to do we each other.\r\n\r\nThe fact that they have the same values in development is a pure chance.\r\n\r\n```\r\nhost = 0.0.0.0\r\nport = 8888\r\n```\r\n\r\nIs use to serve the app with waitress (which is used in production only)\r\n\r\n```\r\n[uwsgi]\r\nsocket = 127.0.0.1:8888\r\n```\r\n\r\nWe will never have to use such a setup because in production we will use file sockets.\r\n\r\n```\r\nsocket = /run/wsgi/kinto.sock\r\n```\r\n\r\n```\r\nkinto.http_host = localhost:8888\r\n```\r\n\r\nThis one is the public address when kinto have to name itself.\r\n\r\nSo in production the setup will be:\r\n\r\n```\r\n[uwsgi]\r\nsocket = /run/wsgi/kinto.sock\r\n\r\nkinto.http_host = kinto.services.mozilla.com\r\n```\r\n\r\nAs you can see we need to keep all of this settings.\r\n\r\n``kinto.http_host`` should never ever looks like ``0.0.0.0:8000`` because 0.0.0.0 is not a correct ip address to name a kinto server."}}