 Nginx配置文件服务器-开启目录浏览功能
Nginx配置文件服务器-开启目录浏览功能
  # 配置文件服务器(开启目录浏览功能)
| 配置 | 说明 | 
|---|---|
| autoindex on; | 开启目录浏览功能 | 
| autoindex_exact_size off; | 默认为on,显示出文件的确切大小,单位是bytes。 改为off后,显示出文件的大概大小,单位是kB或者MB或者GB | 
| autoindex_localtime on; | 默认为off,显示的文件时间为GMT时间。 改为on后,显示的文件时间为文件的服务器时间 | 
| autoindex_format html; | 默认为html,以html格式显示目录 xml,以xml格式显示 json,以json格式显示 | 
| charset utf-8; | 设置展示的编码格式,出现乱码的时候可以通过这个设置进行修改 | 
    server {
        listen  11111;
        server_name localhost;
        location / {
            root /root/pic/;
            access_log /root/pic/images.log;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
            autoindex_format html;
            charset utf-8;
        }
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
上次更新: 2023/03/10, 16:49:38
