文件浏览功能使用 ngx_http_autoindex_module 模块实现,可选配置项不多。
location / {
    root /path/to/folder/;  
    autoindex on | off;   #开启nginx目录浏览功能
    autoindex_exact_size on | off;   #文件大小的大小格式
    autoindex_localtime on | off;   #服务器是否使用本地时间
}
在实际使用中,建议使用 location 搭配路由访问。