Nginx 配置目录浏览

server {
    listen 80;
    server_name share.yjsec.com;
    location / {
        root /opt/tools;                #指定目录所在路径
        autoindex on;                   #开启目录浏览
        autoindex_format html;          #以html风格将目录展示在浏览器中
        autoindex_exact_size off;       #切换为 off 后,以可读的方式显示文件大小,单位为 KB、MB 或者 GB
        autoindex_localtime on;         #以服务器的文件时间作为显示的时间
        charset gbk,utf-8;              #展示中文文件名
    }
}

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注