nginx

Module ngx_http_index_module


english
русский

简体中文
עברית
日本語
türkçe

news
about
download
security advisories
documentation
pgp keys
faq
links
books
support
donation

trac
wiki
twitter
nginx.com
Example Configuration
Directives
     index

The module ngx_http_index_module processes requests ending with the slash character (‘/’). Such requests can also be processed by ngx_http_autoindex_module and ngx_http_random_index_module modules.

Example Configuration

location / {
    index index.$geo.html index.html;
}

Directives

syntax: index file ...;
default:
index index.html;
context: http, server, location

Defines files that will be used as an index. The file name can contain variables. Files are checked in the specified order. The last element of the list can be a file with an absolute path. Example:

index index.$geo.html index.0.html /index.html;

It should be noted that when using an index file, an internal redirect is made, and request can be processed in a different location. For example, with the following configuration:

location = / {
    index index.html;
}

location / {
    ...
}

a request of “/” will actually be processed in the second location as “/index.html”.