模块 ngx_http_index_module
示例配置 Directives 索引 |
这ngx_http_index_module
模块处理请求
以斜杠字符 ('') 结尾。
此类请求也可以由 ngx_http_autoindex_module 和 ngx_http_random_index_module 模块处理。/
示例配置
location / { index index.$geo.html index.html; }
Directives
语法: |
index |
---|---|
默认值: |
index index.html; |
上下文: |
http ,server ,location |
定义将用作索引的文件。
这file
name 可以包含变量。
按指定的顺序检查文件。
列表的最后一个元素可以是具有绝对路径的文件。
例:
index index.$geo.html index.0.html /index.html;
应该注意的是,使用索引文件会导致internal重定向, 并且可以在其他位置处理请求。 例如,使用以下配置:
location = / { index index.html; } location / { ... }
“” 请求实际上将在
第二个位置作为”/
/index.html
”.