1

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;
     }
Caleb
  • 11,813
  • 4
  • 36
  • 49
Quandary
  • 1,024
  • 4
  • 19
  • 36

1 Answers1

1

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;
    }
}
Martin Fjordvald
  • 7,749
  • 1
  • 30
  • 35