ngx_http_autoindex_module 模組

範例設定
指令
     autoindex
     autoindex_exact_size
     autoindex_format
     autoindex_localtime

ngx_http_autoindex_module 模組處理以斜線字元 (/) 結尾的請求,並產生目錄清單。 通常,當 ngx_http_index_module 模組找不到索引檔案時,請求會傳遞給 ngx_http_autoindex_module 模組。

範例設定

location / {
    autoindex on;
}

指令

語法 autoindex on | off;
預設值
autoindex off;
內容 http, server, location

啟用或停用目錄清單輸出。

語法 autoindex_exact_size on | off;
預設值
autoindex_exact_size on;
內容 http, server, location

對於 HTML 格式,指定是否應在目錄清單中輸出確切的檔案大小,還是將其四捨五入為 KB、MB 和 GB。

語法 autoindex_format html | xml | json | jsonp;
預設值
autoindex_format html;
內容 http, server, location

此指令出現在 1.7.9 版中。

設定目錄清單的格式。

當使用 JSONP 格式時,回呼函數的名稱會使用 callback 請求引數設定。 如果引數遺失或值為空,則會使用 JSON 格式。

可以使用 ngx_http_xslt_module 模組轉換 XML 輸出。

語法 autoindex_localtime on | off;
預設值
autoindex_localtime off;
內容 http, server, location

對於 HTML 格式,指定目錄清單中的時間應以當地時區或 UTC 輸出。