Appearance
模块 ngx_http_autoindex_module
ngx_http_autoindex_module模块处理以斜杠字符('/')结尾的请求,并生成目录列表。通常,当ngx_http_index_module模块找不到索引文件 时,会将请求传递给该ngx_http_autoindex_module模块。
示例配置
可以配置在nginx.conf中:
txt
location / {
autoindex on;
}指令
启用或禁用目录列表输出。
txt
Syntax: autoindex on | off;
Default: autoindex off;
Context: http, server, location指定输出文件大小
指定是否在 目录列表中输出确切的文件大小,或者四舍五入到千字节、兆字节和千兆字节。
txt
Syntax: autoindex_exact_size on | off;
Default: autoindex_exact_size on;
Context: http, server, location设置目录列表的格式
txt
Syntax: autoindex_format html | xml | json | jsonp;
Default: autoindex_format html;
Context: http, server, location
This directive appeared in version 1.7.9.使用 JSONP 格式时,回调函数的名称会通过callback请求参数设置。如果缺少该参数或参数值为空,则使用 JSON 格式。
可以使用ngx_http_xslt_module模块 转换 XML 输出 。
时区
指定目录列表中的时间以本地时区还是UTC时间输出。
txt
Syntax: autoindex_localtime on | off;
Default: autoindex_localtime off;
Context: http, server, location