Module ngx_http_index_module nginx的首頁模塊

Example Configuration:例子配置文件
Directives 指令
     index  首頁
html

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

這個nginx模型進程請求帶有/結尾的請求,這類請求也能夠被處理被ngx http自動首頁模型和nginx的http隨機首頁模型網絡

Example Configuration

 例子配置dom

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: spa

定義文件要求被做爲首頁使用。這個文件包括變量。文件在特定排序被選擇。最後的列表的變量能夠是一個有絕對路徑的文件code

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

 

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

他應該被記錄使用一個首頁文件引起一個網絡轉發,而且請求在不一樣位置被處理。例如用下邊的配置htm

location = / {
    index index.html;
}

location / {
    ...
}

a 「/」 request will actually be processed in the second location as 「/index.html」.排序

相關文章
相關標籤/搜索