Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp mvc home root not working with mono, fastcgi and nginx

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;
    }
like image 209
Razvan Dimescu Avatar asked Feb 09 '11 14:02

Razvan Dimescu


2 Answers

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.

like image 118
Brett Avatar answered Oct 07 '22 02:10

Brett


Change fastcgi_index Default.aspx;

to

fastcgi_index /Home;

like image 39
Yitzchok Avatar answered Oct 07 '22 00:10

Yitzchok