mtmacdonald
mtmacdonald

Reputation: 15080

ASP.net MVC with Mono and Nginx - how to configure the index file

I'm trying to use Mono 3.2.8, ASP.NET 4.0, MonoDevelop 5.10 and Nginx 1.4.6 to run the MonoDevelop template project (ASP.NET MVC Project). It runs with the mono-xsp4 server, but with Nginx I get a 404 error:

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. Details: Requested URL: /Default.aspx

The nginx configuration looks like this:

server {
        listen 80;

        location / {
                root /share/test/;
                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;
        }
}

Which file is the index file for an ASP.NET MVC application, and how do I configure this in Nginx?

Upvotes: 2

Views: 1990

Answers (1)

Matthew Blott
Matthew Blott

Reputation: 209

This has already been answered here. The key line is this one ...

fastcgi_index Default.aspx;

Which should be changed to ...

fastcgi_index /;

This caught me out, especially as I already had sites running under Mono. I also agree with Gusman, I'd upgrade to a more recent version of Mono as I find the more recent ones a lot more stable.

Upvotes: 2

Related Questions