Nginx服务器配置nginx.conf打开目录浏览的方法
时间:2015-01-21 23:16 来源:linux.it.net.cn 作者:IT
在Nginx下默认是不允许列出整个目录的。如需此功能,
先打开nginx.conf文件,在location server 或 http段中加入
autoindex on;
另外两个参数最好也加上去:
autoindex_exact_size off;
默认为on,显示出文件的确切大小,单位是bytes。
改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。
注意:改为on后,显示的文件时间为文件的服务器时间
server{
listen 80;
servername www.A.com;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
root /home/www/;
}
(责任编辑:IT)
在Nginx下默认是不允许列出整个目录的。如需此功能,
先打开nginx.conf文件,在location server 或 http段中加入
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
server{ |