打开nginx.conf文件,在location server 段中加入
autoindex on;
autoindex_exact_size off;
默认为on,显示出文件的确切大小,单位是bytes。改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。改为on后,显示的文件时间为文件的服务器时间
allow all
允许某个ip或者一个ip段访问
配置如下
location /logs {
alias /data/logs/dm;
allow all;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}