asp mvc home root not working with mono, fastcgi a

2019-02-05 08:05发布

问题:

i have mono 2.6.7 and I'm trying to port an ASP.NET MVC application. i've managed to solve the case sensitivity problem by setting the variable MONO_IOMAP=all . I have still one more problem, my home root isn't working. I get a page not found error (although /home and /home/index work). I'm using nginx and fastcgi. here is my configuration for nginx:

server {
    listen       80;
    server_name  mydomain.com;
    access_log   /var/log/nginx/mydomain.com.log;

    location / {
        root  /home/ec2-user/www/mydomain-web/;
        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;
    }

回答1:

This ended up working for me.

server {
    listen       80;
    server_name  mydomain.com;
    access_log   /var/log/nginx/mydomain.com.log;

    location / {
        root  /home/ec2-user/www/mydomain-web/;
        fastcgi_index /;
        fastcgi_pass 127.0.0.1:9000;
        include /etc/nginx/fastcgi_params;
}

I removed the index line completely and changed the fastcgi_index to fastcgi_index /;. Using Mono 3.0.3/ASP.NET MVC3.



回答2:

Change fastcgi_index Default.aspx;

to

fastcgi_index /Home;