NGINX / fascgi-mono-server4 - 多个站点

NGINX / fascgi-mono-server4 - 多个站点

这是我的/etc/nginx/sites-available/default

# Sample site
server {
        listen   80; ## listen for ipv4

        server_name  web;

        access_log  /var/log/nginx/web.access.log;

        location / {
                root   /srv/www/web/;
                index  default.cshtml Default.cshtml;
                fastcgi_index Default.cshtml;
                fastcgi_pass 127.0.0.1:9000;
                include /etc/nginx/fastcgi_params;
        }
}

# Another Sample site
server {
        listen   80; ## listen for ipv4

        server_name  irws;

        access_log  /var/log/nginx/irws.access.log;

        location / {
                root   /srv/www/irws/;
                index  default.cshtml Default.cshtml;
                fastcgi_index Default.cshtml;
                fastcgi_pass 127.0.0.1:9000;
                include /etc/nginx/fastcgi_params;
        }
}

这是我开始的脚本fastcgi-mono-server4

export MONO_IOMAP=all  
fastcgi-mono-server4 /address=127.0.0.1 /applications=irws:/:/srv/www/irws/,web:/:/var/www/web/ /socket=tcp:9000 &

我不明白为什么只有/applications参数中定义的第一个应用程序有效。在这种情况下,只有http://irws/有效,但http://web/没有。如果我将它们切换到:

fastcgi-mono-server4 /address=127.0.0.1 /applications=web:/:/srv/www/web/,irws:/:/var/www/irws/ /socket=tcp:9000 &

然后才http://web/开始工作,然后http://irws就停止工作了。我觉得我在这里遗漏了一些非常简单的东西。

我收到的错误消息如下:

Directory does not exists Parameter name: value

Description: HTTP 400. Error processing request.

Stack Trace:

System.ArgumentException: Directory does not exists
Parameter name: value
  at System.IO.FileSystemWatcher.set_Path (System.String value) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:set_Path (string)
  at System.Web.HttpRuntime.SetupOfflineWatch () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.RealProcessRequest (System.Object o) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.ProcessRequest (System.Web.HttpWorkerRequest wr) [0x00000] in <filename unknown>:0 
  at Mono.WebServer.MonoWorkerRequest.ProcessRequest () [0x00000] in <filename unknown>:0 

知道我可能遗漏了什么吗?

答案1

--applications参数指定同一虚拟主机内的路径。您可能需要编写一个webapp 文件并用参数指定它--appconfigfile以便服务多个虚拟主机。

相关内容