ASP.Net MVC 2 on nginx / mono 2.8

I am trying to configure an ASP.Net MVC 2 application in a Linux environment. I installed Ubuntu 10.10 on VirtualBox and then installed Mono 2.8 from sources. After that, I installed nginx and configured it as recommended here . Unfortunately, FastCGI shows me a standard page with a 500 error:

No Application Found Unable to find a matching application for request: Host localhost:80 Port 80 Request Path /Default.aspx Physical Path /var/www/mvc/Default.aspx 

My application is located in the / var / www / mvc directory. I tried to create the Default.aspx stub file and put it in the root directory of my application, but this did not help, the same error occurred. Thanks.

+7
source share
6 answers

Does your application work with xsp (xsp4 if you are using .net 4.0)? You must ensure that this works before attempting to configure a connection to another web server.

Does nginx know where to look for mono? You most likely have a parallel installation, and it will not be used by default.

I use apache, but you can still find some of the instructions on my blog: http://tqcblog.com/2010/04/02/ubuntu-subversion-teamcity-mono-2-6-and-asp-net-mvc /

+2
source

I also tested this using all ubuntu10.10 binaries. From what I can do from it, either nginx cannot pass the host name of the mono server, which cannot receive it via the fastcgi protocol. Anyway, the training line:

  fastcgi-mono-server2 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 

does not work. Removing the host name does the job:

  fastcgi-mono-server2 /applications=/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 

but this, of course, blocks the use of multiple virtual hosts.

+17
source

Since you are using an ASP.NET MVC 2 application, you must use fastcgi-mono-server4.

+3
source

Adding the following line to / etc / nginx / fastcgi _param solves the problem for me. It also allows the use of multiple virtual hosts.

 fastcgi_param HTTP_HOST $host; 
+3
source

I had this problem only now, I also followed the document on the mono site:

I tried to run fastcgi-mono-server as he suggested:

 sudo fastcgi-mono-server4 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 & 

However, when I did this, I had the same problem as you. I changed it to the following:

 sudo fastcgi-mono-server4 /applications=/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 & 

And it worked (I had to type on www.domain1.xyz/Home/Index to see my MVC page, I didn’t figure out how to stop it by looking at www.domain1.xyz/default.aspx, but XD).

+2
source

You need to make sure that the domain specified in the configuration of your site corresponds to the domain transferred to the fastcgi server. For example, if your default site ( /etc/nginx/sites-enabled/default ) has the following configuration:

 server { ... server_name www.domain1.xyz; ... } 

You will need to transfer this domain to the fastcgi server:

 sudo fastcgi-mono-server4 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ ... 

Then, when you get access to the site, it obviously should be with the domain you specified.

+1
source

All Articles