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 |
|---|---|
| デフォルト |
autoindex off; |
| コンテキスト |
http、server、location |
ディレクトリ一覧の出力を有効または無効にします。
| 構文 |
autoindex_exact_size |
|---|---|
| デフォルト |
autoindex_exact_size on; |
| コンテキスト |
http、server、location |
HTML フォーマットの場合は、ファイルの正確なサイズをディレクトリ一覧に出力するか、キロバイト、メガバイト、ギガバイトに丸めるかを指定します。
| 構文 |
autoindex_format |
|---|---|
| デフォルト |
autoindex_format html; |
| コンテキスト |
http、server、location |
このディレクティブはバージョン 1.7.9 で登場しました。
ディレクトリ一覧のフォーマットを設定します。
JSONP フォーマットを使用する場合、コールバック関数の名前は callback リクエスト引数で設定されます。引数が不足しているか、空の場合、JSON フォーマットが使用されます。
XML 出力は ngx_http_xslt_module モジュールを使用して変換できます。
| 構文 |
autoindex_localtime |
|---|---|
| デフォルト |
autoindex_localtime off; |
| コンテキスト |
http、server、location |
HTML フォーマットの場合は、ディレクトリ一覧の時間をローカルタイムゾーンまたは UTC で出力するかを指定します。