This is my scotty app, notice how I am logging requests to the console:
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Network.Wai.Middleware.RequestLogger
import Data.Monoid (mconcat)
main = scotty 3000 $ do
--log requests to console
middleware logStdoutDev
get "/:word" $ do
beam <- param "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]
My scotty app runs behind nginx using the proxy mechanism. This causes the scotty app to log like this:
127.0.0.1 - - [27/Aug/2014:15:12:00 +0000] "GET / HTTP/1.0" 200 - ...
I want the REAL IP ADDRESS to be logged.
I had the same issue in my Node.js/Express apps, where I solved it like this:
Express.js: how to get remote client address
How do I solve this problem in Scotty?
MonadIO
instance for the stuff thatmkRequestLogger
returns.) Do you have time to look at what changed in the meantime and how to get around it? I'd be happy to give you +50 bounty award for it. Thank you. – Tempera