Hi.
<div><br></div><div>This is probably &quot;I must be blind department&quot;</div><div><br></div><div>I have a very basic strip down echo cgi that runs with apache2.</div><div><br></div><div>When I try to modfi it to be a FastCGI instead and run it with spawn-fcgi with nginx</div>
<div>It don&#39;t behave as expected.</div><div>I suppose that the line that don&#39;t get any data is mn &lt;-  getInputFPS &quot;file&quot; when running under FastGCI.</div><div>So is the code wrong? or have I missed something with the setup?</div>
<div><br></div><div>I can run the example of fastcgi provided in <a href="http://mult.ifario.us/p/wiring-haskell-into-a-fastcgi-web-server">http://mult.ifario.us/p/wiring-haskell-into-a-fastcgi-web-server</a> with no problem.</div>
<div><br></div><div><br></div><div>Description:    Ubuntu 10.04 LTS</div><div>2.6.32-22-generic-pae #36-Ubuntu SMP</div><div>The Glorious Glasgow Haskell Compilation System, version 6.12.1</div><div><br></div><div>+++++</div>
<div><div>import Control.Concurrent</div><div>import Network.CGI</div><div>-- import Network.FastCGI</div><div>import Text.Html</div><div>import qualified Data.ByteString.Lazy as BS</div><div>import qualified Data.ByteString.Lazy.Char8 as BS8</div>
<div>import Control.Monad (liftM)</div><div>import Data.Maybe (fromJust)</div><div>import Char</div><div>import Data.List</div><div>import System.Time</div><div>import qualified Data.ByteString.Char8 as C</div><div>import Text.JSON.Generic</div>
<div>import Text.JSON</div><div><br></div><div>insertthis fb =  do</div><div>  let f = BS8.unpack  fb</div><div>  return (f)</div><div><br></div><div><br></div><div><br></div><div><br></div><div>fileForm = form ! [method &quot;post&quot;, enctype &quot;multipart/form-data&quot;]</div>
<div>             &lt;&lt; [textfield &quot;file&quot;, submit &quot;&quot; &quot;Upload&quot;]</div><div><br></div><div><br></div><div><br></div><div>saveFile cont =</div><div>    do r&lt;-liftIO $ insertthis  cont</div>
<div>       return $ paragraph &lt;&lt; (&quot;Inserted &quot; ++ (show r))</div><div><br></div><div>page t b = header &lt;&lt; thetitle &lt;&lt; t +++ body &lt;&lt; b</div><div><br></div><div><br></div><div><br></div><div>
<br></div><div>test :: CGI CGIResult</div><div>test = do setHeader &quot;Content-Type&quot; &quot;text/html; charset=utf-8&quot;</div><div>          mn &lt;-  getInputFPS &quot;file&quot;</div><div>          h &lt;- maybe (return fileForm) saveFile mn</div>
<div><div>          output $  renderHtml $ page &quot;Upload&quot; h</div><div><br></div><div><br></div><div>main = runCGI $ handleErrors test</div><div><br></div></div></div><div>--main= runFastCGI $ handleErrors test</div>
<div><br></div><div>+++++</div>