Loading

NGINX配置显示目录文件列表

autoindex on;  # 开启目录文件列表
autoindex_exact_size on;  # 显示出文件的确切大小,单位是bytes
autoindex_localtime on;  # 显示的文件时间为文件的服务器时间
charset utf-8,gbk;  # 中文编码
add_header Content-Disposition attachment;   #文件是下载而不是显示内容
add_header Content-Type text/plain;    #文件是显示而不是下载,可以用来发布日志目录

美化参考:

https://github.com/Naereen/Nginx-Fancyindex-Theme

https://github.com/TheInsomniac/Nginx-Fancyindex-Theme

https://github.com/lanffy/Nginx-Fancyindex-Theme

 

目录美化配置

include /usr/local/nginx/html/Nginx-Fancyindex-Theme/fancyindex.conf; # 目录美化

posted @ 2022-05-21 09:40  上官飞鸿  阅读(593)  评论(0编辑  收藏  举报