running mvc on nginx

Shih-Chi Chen shihchichen2011 at
Thu Aug 19 06:29:07 MSD 2010


I am trying to run mvc with nginx under ubuntu Linux.

Here is part of my setting for /etc/nginx/sites-available/default

ver {
         listen   80;
         server_name  localhost;
         access_log   /var/log/nginx/;

         location / {
                 root /var/www/MvcTest;
                 index Default.aspx Index.aspx;
                 fastcgi_index Index.aspx;
                 include /etc/nginx/fastcgi_params;

MvcTest is from publishing an MVC project from visual studio 2008. The code
is autogenerated by visual studio so it's very simple. It can show simple
greeting message.\
The folder has sub-directories like bin, Content, Scripts, Views and etc.
Index.aspx is under Views/Home

However when i try to run that on nginx with
sudo fastcgi-mono-server2 /applications=localhost:/:/var/www/MvcTest/

I got Error 404

Server Error in '/' Application
*The resource cannot be found.*

*Description: *HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure that
it is spelled correctly.
*Version information: * Runtime: Mono 2.4.4; ASP.NET Version: 2.0.50727.1433

I am guessing is it because nginx didnt find Index.aspx?
I tried the similar thing with nginx-default and it worked well.

However if i put nginx-default under another folder called deepFolder and
set root to deepFolder, the index.html will not be displayed and that's why
i had this assumption.

Would you give me some advices?

Sincerely Yours

Steven Shih-Chi Chen

Steven Shih-Chi Chen

MS Candidate in Computer Engineering
McCormick School of Engineering and Applied Science
Northwestern University
(847) 845-1519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list