Module ngx_http_index_module nginx的首页模块
Example Configuration:例子配置文件
Directives 指令
index 首页
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模型进程请求带有/结尾的请求,这类请求也可以被处理被ngx http自动首页模型和nginx的http随机首页模型
Example Configuration
例子配置
location / { index index.$geo.html index.html; }
Directives
Syntax: | index |
---|---|
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 using an index file causes an internal redirect, and the request can be processed in a different location. For example, with the following configuration:
他应该被记录使用一个首页文件引发一个网络转发,并且请求在不同位置被处理。例如用下边的配置
location = / { index index.html; } location / { ... }
a “/
” request will actually be processed in the second location as “/index.html
”.