配置文件服务器,在web上现实目录下的文件列表
相关模块 ngx_http_autoindex_module
1、概述
该模块处理以斜线(/)结尾的请求,并生成一个目录列表,如图:
通常,当ngx_http_index_module模块找不到index文件时,请求会被传递给ngx_http_autoindex_module模块
2、配置说明
相关配置指令:autoindex、autoindex_exact_size、autoindex_format、autoindex_localtime
2.1 autoindex
Syntax: autoindex on | off; #配置语法
Default: autoindex off; #默认值
Context: http, server, location #在配置文件中的位置
2.2 autoindex_exact_size
Syntax: autoindex_exact_size on | off;
Default:
autoindex_exact_size on;
Context: http, server, location
2.3 autoindex_format
显示文件列表信息的格式
Syntax: autoindex_format html | xml | json | jsonp;
Default:
autoindex_format html;
Context: http, server, location
This directive appeared in version 1.7.9.
html格式:
json格式:
xml格式:
jsonp格式:
当请求中携带callback参数时,会返回一个callback参数值同名的方法,如果callback不存在或者值为零,则按json格式处理
2.4 autoindex_localtime
Syntax: autoindex_localtime on | off;
Default:
autoindex_localtime off;
Context: http, server, location
未完待续。。。。