Skip to content

Commit

Permalink
Set X-Forwarded-Proto correctly yesodweb/yesod-scaffold#114
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Dec 6, 2015
1 parent de38187 commit af00b76
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion yesod-bin/Devel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ reverseProxy opts iappPort = do
let cert = $(embedFile "certificate.pem")
key = $(embedFile "key.pem")
tlsSettings = tlsSettingsMemory cert key
runTLS tlsSettings (setPort port defaultSettings) app
runTLS tlsSettings (setPort port defaultSettings) $ \req send -> do
let req' = req
{ requestHeaders
= ("X-Forwarded-Proto", "https")
: requestHeaders req
}
app req' send
httpProxy = run (develPort opts) proxyApp
httpsProxy = runProxyTls (develTlsPort opts) proxyApp
putStrLn "Application can be accessed at:\n"
Expand Down

0 comments on commit af00b76

Please sign in to comment.