原创文章,转载请指明出处并保留原文url地址
本文主要针对nginx的ngx_http_autoindex_module模块做简单介绍,本文具体包括如下指令:autoindex,autoindex_exact_size,auth_basic_user_file
ngx_http_autoindex_module模块处理‘/’结尾的请求,并且产生一个目录列表。通常当 ngx_http_index_module模块不能发现一个index文件时将请求传递给本模块。
Example Configuration
location / {
autoindex on;
}
Nginx原文:
The ngx_http_autoindex_module module processes requests ending with the slash character (‘/’) and produces a directory listing. Usually a request is passed to the ngx_http_autoindex_module module when the ngx_http_index_module module could not find an index file.
Example Configuration
location / {
autoindex on;
}
1. autoindex
syntax: | autoindex on | off; |
default: | autoindex off; |
context: | http, server, location |
启用或禁用目录列表输出。
Nginx原文:
Enables or disables a directory listing output.
2. autoindex_exact_size
syntax: | autoindex_exact_size on | off; |
default: | autoindex_exact_size on; |
context: | http, server, location |
指定是否在目录列表中的文件大小应该是输出准确,或调整为千字节,兆字节和千兆字节。
Nginx原文:
Specifies whether file sizes in the directory listing should be output exactly, or rounded to kilobytes, megabytes, and gigabytes.
3. auth_basic_user_file
syntax: | autoindex_localtime on | off; |
default: | autoindex_localtime off; |
context: | http, server, location |
指定在目录列表中应该出现当地的时区或UTC时区输出。
Nginx原文:
Specifies whether times in the directory listing should be output in a local time zone or UTC.