ngx_http_autoindex_module 模块处理以斜杠字符(‘/’)结尾的请求并生成目录列表。通常,当 ngx_http_index_module 模块找不到索引文件时,会将请求传递给 ngx_http_autoindex_module 模块。
location / {
autoindex on;
}语 法:autoindex on | off;
默认值:autoindex off;
上下文:http, server, location启用或禁用目录列表输出。
语 法:autoindex_exact_size on | off;
默认值:autoindex_exact_size on;
上下文:http, server, location对于 HTML 格式,指定是否应在目录列表中输出确切的文件大小,或者四舍五入到千字节、兆字节和千兆字节。
语 法:autoindex_format html | xml | json | jsonp;
默认值:autoindex_format html;
上下文:http, server, location该指令出现在 1.7.9 版中。
设置目录列表的格式。
使用 JSONP 格式时,回调函数的名称由回调请求参数设置。如果参数缺失或值为空,则使用 JSON 格式。
XML 输出可以使用 ngx_http_xslt_module 模块进行转换。
语 法:autoindex_localtime on | off;
默认值:autoindex_localtime off;
上下文:http, server, location对于 HTML 格式,指定目录列表中的时间应以本地时区还是 UTC 输出。