我一直在寻找与我的问题相关的post,但我还没有find。 我是绝望的,我按照指导安装和configurationnginx与fastcgi单声道服务器( http://www.mono-project.com/FastCGI_Nginx ),我做了所有的指导如何说,但我不能做那nginx可以解释asp页面。
我在/ etc / nginx / sites-available / default中的configuration页面:
server{ listen 80; server_name prueba; access_log /var/log/nginx/prueba.access.log; location / { root /var/www/prueba/; index index.html index.htm default.aspx Default.aspx; fastcgi_index Default.aspx; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; } }
/ etc / nginx / fastcgi_params的configuration:
fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $https; fastcgi_param PATH_INFO ""; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REDIRECT_STATUS 200;
我在/ var / www / prueba /中创build了一个Default.aspx页面,
现在我运行:
fastcgi-mono-server2 / applications = prueba:/:/ var / www / prueba / /socket=tcp:127.0.0.1:9000
之后,我开始nginx:
/etc/init.d/nginx开始
当我尝试访问“ http:// localhost / ”或“ http:// localhost:80 / ”show me:
No Application Found Unable to find a matching application for rquest: Host localhost Port 80 Request Path /Default.aspx Physical Path /var/www/prueba/Default.aspx
我希望你能帮助我。
当启动fastcgi-mono-server时,我认为它应该是这样的:
fastcgi-mono-server2 /applications=/prueba:/var/www/prueba/ /socket=tcp:127.0.0.1:9000
我个人使用这条线让我的运行:
MONO_IOMAP=all fastcgi-mono-server4 /socket=tcp:9000 /address=127.0.0.1 /applications=/:.,/dlr:/var/www/dotnet/dlr /logfile=/var/log/lighttpd/fastcgi.log &
正如你可以看到我的使用fastcgi-mono-server4。 它可能会以同样的方式工作。
要诊断这类错误,请尝试添加其他参数以运行fastcgi-mono-server:
/printlog=True /loglevel=All /verbose=True
因此,您将在控制台中看到发送了哪个应用程序请求。
错误configuration的服务器的输出示例:
[2014-09-30 02:47:45Z] Notice Beginning to receive records on connection. No application defined for: 127.0.0.1:80/default.aspx [2014-09-30 02:47:45Z] Notice Finished receiving records on connection.
你应该删除或注释掉fastcgi_index Default.aspx; 在你的configuration。
你必须做到以下几点:
例如你在conf中指定。 将文件名为“prueba”的端口80(默认),所以应该和下面一样。
在框架2的情况下:
fastcgi-mono-server2 /applications=prueba:/:/var/www/prueba/ /socket=tcp:127.0.0.1:9000
在框架4的情况下:
fastcgi-mono-server4 /applications=prueba:/:/var/www/prueba/ /socket=tcp:127.0.0.1:9000
加:
proxy_set_header Host $host;
到你的nginx.conf