配置nginx显示目录文件列表

编程语言
0 600

nginx默认是不支持的,需要通过在location、server或http配置段添加额外参数:


autoindex on;  # 开启目录文件列表
autoindex_exact_size on;  # 显示出文件的确切大小,单位是bytes
autoindex_localtime on;  # 显示的文件时间为文件的服务器时间
charset utf-8,gbk;  # 避免中文乱码