Module ngx_http_autoindex_module

ngx_http_autoindex_module模块处理以斜杠('/')结尾的请求,并生成目录列表。通常,当ngx_http_index_module模块找不到索引文件时,会将请求传递给ngx_http_autoindex_module模块。

Example Configuration

location / {
    autoindex on;
}

Directives

Syntax:autoindex on | off;
Default:autoindex off;
Context:http , server , location

启用或禁用目录列表输出。

Syntax:autoindex_exact_size on | off;
Default:autoindex_exact_size on;
Context:http , server , location

对于 HTML format,指定是否在目录列表中输出确切的文件大小,或者四舍五入为千字节,兆字节和千兆字节。

Syntax:autoindex_format html | xml | json | jsonp;
Default:autoindex_format html;
Context:http , server , location

该指令出现在版本 1.7.9 中。

设置目录列表的格式。

使用 JSONP 格式时,将使用callback request 参数设置回调函数的名称。如果参数丢失或值为空,则使用 JSON 格式。

可以使用ngx_http_xslt_module模块转换 XML 输出。

Syntax:autoindex_localtime on | off;
Default:autoindex_localtime off;
Context:http , server , location

对于 HTML format,指定是否应在本地时区或 UTC 中输出目录列表中的时间。