3

I'm trying to get Mono working with nginx using fastcgi-mono-server4. nginx and fastcgi-mono-server4 are apparently in communication (I can get that far using both a unix and a tcp socket), but once fastcgi-mono-server4 logs getting an incoming request (when I hit the nginx listen url with my browser), nothing happens and nginx times out with a 504 Gateway Time-out after a bit. Here's the log from the fastcgi-mono-server4 process (I'm running everything as root, including the nginx workers processes, to rule out permissions problems):

$ sudo MONO_OPTIONS="--debug" MONO_IOMAP=all fastcgi-mono-server4 /printlog=True /applications=/test:/home/friis/code/TestingMono/TestingMono/ /socket=tcp:127.0.0.1:9000 /loglevels=Debug
[2013-07-31 21:33:15Z] Debug   fastcgi-mono-server4
[2013-07-31 21:33:15Z] Debug   Listening on port: 127.0.0.1
[2013-07-31 21:33:15Z] Debug   Listening on address: 9000
[2013-07-31 21:33:15Z] Debug   Root directory: /home/friism/code/TestingMono/TestingMono
[2013-07-31 21:33:15Z] Debug   Max connections: 1024
[2013-07-31 21:33:15Z] Debug   Max requests: 1024
[2013-07-31 21:33:15Z] Debug   Multiplex connections: False
[2013-07-31 21:33:54Z] Debug   Accepting an incoming connection.
[2013-07-31 21:33:54Z] Notice  Beginning to receive records on connection.
[2013-07-31 21:33:54Z] Debug   Record received. (Type: BeginRequest, ID: 1, Length: 8)

The TestingMono directory holds an ASP.NET application that serves just fine using xsp4.

Any suggestions for debugging this problem?

Versions:

$ mono --version
Mono JIT compiler version 3.0.12 (master/d6c5db8 Sat Jun 15 20:13:22 PDT 2013)
$ fastcgi-mono-server4 --version
fastcgi-mono-server4.exe 3.0.0.0

UPDATE

nginx config:

server { 
         listen 8080;
         server_name localhost;
         access_log   /var/log/nginx/your.domain1.xyz.access.log;

         location / {
                 fastcgi_pass 127.0.0.1:9000;
                 # fastcgi_pass unix:/tmp/nginx.socket;
                 include /etc/nginx/fastcgi_params;
         }
}
miniBill
  • 1,743
  • 17
  • 41
friism
  • 19,068
  • 5
  • 80
  • 116
  • what version of mono and what version of mono-fastcgi? – knocte Jul 29 '13 at 13:03
  • It's mono 3.0.12 and and fastcgi-mono-server4 3.0.0.0 - added to question. – friism Jul 29 '13 at 16:15
  • 3.0.0.0 is not very informative, how did you install fastcgi-mono-server4? did you compile the master branch of xsp repo? – knocte Jul 29 '13 at 18:18
  • @knocte I built XSP from the 3.0.11 tag on GitHub. – friism Jul 29 '13 at 19:56
  • it's the correct tag, so that is strange; I recommend you post the output you get when you turn logging ON – knocte Jul 29 '13 at 19:59
  • I also recommend you to test with a unix socket file instead of local port redirection – knocte Jul 29 '13 at 20:00
  • @knocte how to I get more logging than with `/printlog=True` and `/loglevels=Debug`? I've also experimented using unix socket, but will try again. – friism Jul 29 '13 at 23:13
  • @friism `--loglevels All`, also you could try to use master from https://github.com/mono-soc-2013/xsp as xsp is undergoing major changes for the Google Summer of Code – miniBill Jul 30 '13 at 11:14
  • Also post your nginx config – miniBill Jul 30 '13 at 11:22
  • @miniBill I've added more debug output and nginx.conf – friism Aug 01 '13 at 04:41
  • @miniBill Interesting, I can get it to work with the tip of the gsoc repo code. Is that safe and good? – friism Aug 01 '13 at 05:05
  • It should be safe and good, but it hasn't undergone the same testing that older versions have. I wonder what's broken in the older tag... – miniBill Aug 01 '13 at 13:34
  • @miniBill I've got it working now. If you have time, I'd love to get your thoughts on whether nginx+fastcgi-mono-server is even a better option than XSP? http://lists.ximian.com/pipermail/mono-list/2013-August/050159.html – friism Aug 05 '13 at 04:08
  • XSP is meant for development, nginx is much more mature, stable, and scalable – miniBill Aug 05 '13 at 10:14

0 Answers0