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