{"action":"opened","issue":{"url":"https://api.github.com/repos/gollum/gollum/issues/1001","labels_url":"https://api.github.com/repos/gollum/gollum/issues/1001/labels{/name}","comments_url":"https://api.github.com/repos/gollum/gollum/issues/1001/comments","events_url":"https://api.github.com/repos/gollum/gollum/issues/1001/events","html_url":"https://github.com/gollum/gollum/issues/1001","id":70422633,"number":1001,"title":"Gollum fails to handle X-Forwarded-Host","user":{"login":"TobyHFerguson","id":6525189,"avatar_url":"https://avatars.githubusercontent.com/u/6525189?v=3","gravatar_id":"","url":"https://api.github.com/users/TobyHFerguson","html_url":"https://github.com/TobyHFerguson","followers_url":"https://api.github.com/users/TobyHFerguson/followers","following_url":"https://api.github.com/users/TobyHFerguson/following{/other_user}","gists_url":"https://api.github.com/users/TobyHFerguson/gists{/gist_id}","starred_url":"https://api.github.com/users/TobyHFerguson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobyHFerguson/subscriptions","organizations_url":"https://api.github.com/users/TobyHFerguson/orgs","repos_url":"https://api.github.com/users/TobyHFerguson/repos","events_url":"https://api.github.com/users/TobyHFerguson/events{/privacy}","received_events_url":"https://api.github.com/users/TobyHFerguson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T14:13:41Z","updated_at":"2015-04-23T14:13:41Z","closed_at":null,"body":"When setting up an Apache 2.2 webserver as a reverse proxy for Gollum 4.0.0 I find that Gollum returns a '404 Not Found' when the header X-Forwarded-Host: is present in the HTTP Get request, but returns '302 Found' when that header is not present. Unfortunately there is not (to my knowledge) a way of stopping Apache 2.2 from sending the X-Forwarded-Host: header.\r\n\r\nThis seems to me to be a bug in Gollum - it should not respond differently based on the presence of this \"standard\" header.\r\n\r\nHere are two telnet sessions - the first shows how Gollum behaves when all the 'proxying' headers except X-Forwarded-Host: is present, the second shows the failure when X-Forwarded-Host: is added:\r\n\r\n```\r\n[Toby@ca-ovsx32 ~]$ telnet localhost 4567\r\nTrying ::1...\r\ntelnet: connect to address ::1: Connection refused\r\nTrying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is '^]'.\r\nGET /wiki HTTP/1.1\r\nHost: localhost:4567\r\nUser-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2\r\nAccept: */*\r\nX-Forwarded-For: 10.80.154.88\r\nX-Forwarded-Server: ca-ovsx32.us.oracle.com\r\nConnection: Keep-Alive\r\n\r\nHTTP/1.1 302 Found\r\nContent-Type: text/html;charset=utf-8\r\nLocation: http://localhost:4567/wiki/Home\r\nContent-Length: 0\r\nX-Xss-Protection: 1; mode=block\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: SAMEORIGIN\r\nServer: WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13)\r\nDate: Thu, 23 Apr 2015 07:15:22 GMT\r\nConnection: Keep-Alive\r\n```\r\n\r\nAnd now the error case:\r\n\r\n```\r\n[Toby@ca-ovsx32 ~]$ telnet localhost 4567\r\nTrying ::1...\r\ntelnet: connect to address ::1: Connection refused\r\nTrying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is '^]'.\r\nGET /wiki HTTP/1.1\r\nHost: localhost:4567\r\nUser-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2\r\nAccept: */*\r\nX-Forwarded-For: 10.80.154.88\r\nX-Forwarded-Host: ca-ovsx32\r\nX-Forwarded-Server: ca-ovsx32.us.oracle.com\r\nConnection: Keep-Alive\r\n\r\nHTTP/1.1 404 Not Found\r\nContent-Type: text/plain\r\nX-Cascade: pass\r\nServer: WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13)\r\nDate: Thu, 23 Apr 2015 07:16:52 GMT\r\nContent-Length: 16\r\nConnection: Keep-Alive\r\n\r\nNot Found: /wiki\r\n```"}}