坏的网关与Debian上的nginx,单声道和fastcgi

我正在努力与Linux的.NET替代单声道。 这是我的元数据:

OS: Debian 7.6 alias Wheezy (as virtual machine; host: Windows 7 Pro SP1) nginx v1.6.1 (installed from nginx repository) mono v3.6.0 (compiled from source) mono-fastcgi-server4 (installed from Debian repositories) 

nginx正常工作; 我没有单声道testing,所以不应该是这个问题。

当我在nginxserver config中启用fastcgi部分时,会出现这个问题:我得到一个502坏的网关。

为了您的信息,这些都是我编辑的所有configuration文件。 我认为这些是重要的:

/etc/nginx/conf.d/default.conf

 server { listen 80; server_name myserver.net; root /var/www/myserver.net; index index.html; location / { fastcgi_index index.html; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; } } 

/ etc / nginx / fastcgi_params (原文除了这两行)

 fastcgi_param PATH_INFO ""; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 

/etc/init.d/mono-fastcgi/myserver.net.webapp

 <apps> <web-application> <name>myserver.net</name> <vhost>*</vhost> <vport>80</vport> <vpath>/</vpath> <path>/var/www/myerver.net/</path> </web-application> </apps> 

mono-fastcgi-server4启动命令(分为多行进行概述)

 fastcgi-mono-server4 --appconfigdir /etc/init.d/mono-fastcgi /socket=tcp:127.0.0.1:9000 /logfile=/var/log/mono/fastcgi.log & 

我其实不知道,为什么最后还要在那里,但是如果没有它,命令将不起作用。 有什么build议么?

我想这是我可以与你分享的所有信息。 如果有什么遗漏,请指出,我会尽快添加信息。

编辑:我忘了添加fastcgi.lognginx日志

/var/log/mono/fastcgi.log

 [2014-09-04 10:39:20Z] Error ERROR PROCESSING REQUEST: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.WebServer.FastCgi.WorkerRequest Server stack trace: at Mono.WebServer.FastCgi.ApplicationHost.ProcessRequest (Mono.WebServer.FastCgi.Responder responder) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at (wrapper xdomain-dispatch) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (object,byte[]&,byte[]&) Exception rethrown at [0]: ---> System.InvalidCastException: Cannot cast from source type to destination type. at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 at Mono.WebServer.FastCgi.WorkerRequest..cctor () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at (wrapper xdomain-invoke) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at Mono.WebServer.FastCgi.Responder.Process () [0x00000] in <filename unknown>:0 [2014-09-04 10:39:20Z] Error Failed to process connection. Reason: The object was used after being disposed. [2014-09-04 10:39:20Z] Notice Beginning to receive records on connection. [2014-09-04 10:39:20Z] Error ERROR PROCESSING REQUEST: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.WebServer.FastCgi.WorkerRequest Server stack trace: at Mono.WebServer.FastCgi.ApplicationHost.ProcessRequest (Mono.WebServer.FastCgi.Responder responder) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at (wrapper xdomain-dispatch) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (object,byte[]&,byte[]&) Exception rethrown at [0]: ---> System.InvalidCastException: Cannot cast from source type to destination type. at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 at Mono.WebServer.FastCgi.WorkerRequest..cctor () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at (wrapper xdomain-invoke) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder) at Mono.WebServer.FastCgi.Responder.Process () [0x00000] in <filename unknown>:0 [2014-09-04 10:39:20Z] Error Failed to process connection. Reason: The object was used after being disposed. 

/var/log/nginx/access.log

 10.0.2.147 - - [04/Sep/2014:10:39:20 +0200] "GET /default.aspx HTTP/1.1" 502 574 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36" "-" 10.0.2.147 - - [04/Sep/2014:10:39:20 +0200] "GET /favicon.ico HTTP/1.1" 502 574 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36" "-" 

/var/www/nginx/error.log

 2014/09/04 10:39:20 [error] 2928#0: *11 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 10.0.2.147, server: lexekon.net, request: "GET /default.aspx HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "lexekon.net" 2014/09/04 10:39:20 [error] 2928#0: *11 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 10.0.2.147, server: lexekon.net, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "lexekon.net"