三個(gè)重要的指令
autoindex on; 在server或location 段里添加上autoindex on;來啟用目錄流量
autoindex_exact_size off;
默認(rèn)為on,顯示出文件的確切大小,單位是bytes。
改為off后,顯示出文件的大概大小,單位是kB或者M(jìn)B或者GB
autoindex_localtime on;
默認(rèn)為off,顯示的文件時(shí)間為GMT時(shí)間。
改為on后,顯示的文件時(shí)間為文件的服務(wù)器時(shí)間
demo
在server段添加
location / {
autoindex on;
autoindex_localtime on; #之類的參數(shù)寫這里
}
單獨(dú)目錄開啟目錄流量
location /down/ {
autoindex on;
}
虛擬目錄開啟目錄流量
location /down/ {
alias /home/wwwroot/lnmp/test/;
autoindex on;
}