I'm using the nginx webserver on Linux for domain "example.com". I forward everything via fastcgi to fastcgi-mono-server4.

Now, everything works fine, I just want to set several index pages, e.g. something like:

fastcgi_index Default.aspx default.aspx index.html index.htm;

But somehow, it doesn't accept multiple values. How can I do this ? Is it possible somehow ? I also tried comma and semicolon as separator, but nothing works...

Here the location entry of the virtual host entry in "sites-available":

     location / {
             root /home/webpages/www/example.com;
             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;
     }
link|improve this question

67% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Mono might not implement it in a way where it accepts multiple values. However. You don't really need this at all as Nginx can handle it just fine.

This following code will test for a directory, if it exists it will apply the index value, if not it will redirect to @default which will fastcgi_pass.

server {
    root /home/webpages/www/example.com;
    index index.html index.htm default.aspx Default.aspx;

    include /etc/nginx/fastcgi_params;

    location / {
        try_files $uri/ @default;
        fastcgi_pass upstream; // Don't think this is required, but just in case.
    }

    location @default {
        fastcgi_pass upstream;
    }
}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.