nginx 列出目錄

Nginx默認是不容許列出整個目錄的。如需此功能,
打開nginx.conf文件,在location server 或 http段中加入
autoindex on;
另外兩個參數最好也加上去:
autoindex_exact_size off;
默認爲on,顯示出文件的確切大小,單位是bytes。
改成off後,顯示出文件的大概大小,單位是kB或者MB或者GB
autoindex_localtime on;
默認爲off,顯示的文件時間爲GMT時間。
改成on後,顯示的文件時間爲文件的服務器時間
location /p_w_picpaths {
                root   /var/www/nginx-default/ibugaocn;
                autoindex on;
        }
詳細參照:http://wiki.nginx.org/NginxChsHttpAutoindexModule
若是想但願目錄列表支持header,footer則能夠安裝三方插件:
http://wiki.nginx.org/NginxNgxFancyIndex


原文地址: http://blog.licess.org/nginx-autoindex/
相關文章
相關標籤/搜索