Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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;
     }
share|improve this question

1 Answer 1

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;
    }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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