歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Nginx目錄浏覽功能(autoindex)

Nginx目錄浏覽功能(autoindex)

日期:2017/3/1 16:35:36   编辑:關於Linux
Nginx目錄浏覽功能(autoindex) Nginx默認是不允許列出整個目錄的。如需此功能, 打開nginx.conf文件,在location server 或 http段中加入 autoindex on; 另外兩個參數最好也加上去: www.2cto.com autoindex_exact_size off; 默認為on,顯示出文件的確切大小,單位是bytes。 改為off後,顯示出文件的大概大小,單位是kB或者MB或者GB autoindex_localtime on; 默認為off,顯示的文件時間為GMT時間。 改為on後,顯示的文件時間為文件的服務器時間 www.2cto.com 例子: 1.location /images { root /var/www/nginx-default/ibugaocn; autoindex on; } 2.location /b { autoindex on; autoindex_exact_size off; #改為off後,顯示出文件的大概大小,單位是kB或者MB或者GB autoindex_localtime on; #顯示的文件時間為文件的服務器時間 limit_rate_after 10m; #10m之後下載速度為10k limit_rate 10k; alias /usr/local/nginx/html/redhat; #別名 }
Copyright © Linux教程網 All Rights Reserved