Accept cookies for analytics, social media, and advertising, or learn more and adjust your preferences. These cookies are on by default for visitors outside the UK and EEA. Privacy Notice.
Fancy Index モジュールは組み込みのautoindexモジュールのようなファイルのリストを生成できるだけでなく、ちょっとした形式を追加します。モジュールは生成されたコンテンツのカスタマイズをある程度できるため、可能です。
このモジュールはIgor Sysoevによって書かれた高パフォーマンスオープンソースwebサーバ、NGINXと連携するように設計されています。
注意
このモジュールをDebian Squeezeを実行しているサーバ上のNGINX 1.0.10でコンパイルしました - しかしREADMEではNGINX 0.8についてのみ話しています。
$ gunzip -c nginx-?.?.?.tar.gz | tar -xvf -
$ git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
--add-module
を必ずつけるようにします。$ cd nginx-?.?.? $ ./configure --add-module=../ngx-fancyindex [extra desired options]
$ make $ sudo make install
以下の行をNGINX設定ファイルの server
セクションに追加することで、デフォルトの組み込みのスタイルをテストすることができます。
location / {
fancyindex on; # Enable fancy indexes.
fancyindex_exact_size off; # Output human-readable file sizes.
}
構文: | fancyindex [on|off] |
---|---|
デフォルト: | off |
コンテキスト: | http, server, location |
fancy ディレクトリ インデックスを有効または無効にする。
構文: | fancyindex_css_href uri |
---|---|
デフォルト: | “” |
コンテキスト: | http, server, location |
生成されたリストにCSSスタイルシートへのリンクを挿入することができます。指定された uriパラメータがそのまま <link>
HTML タグの中に挿入されるでしょう。linkは組み込みのCSSルールのあとに挿入されるため、デフォルトのスタイルを上書きすることができます。
構文: | fancyindex_exact_size [on|off] |
---|---|
デフォルト: | on |
コンテキスト: | http, server, location |
ディレクトリリストの中でファイリサイズをどうやって表現するかを定義します; 詳細、あるいはキロバイト、メガバイト、ギガバイトに丸めるかのどちらかです。
構文: | fancyindex_header path |
---|---|
デフォルト: | “” |
コンテキスト: | http, server, location |
ディレクトリリストの先頭に挿入されるべきファイルを指定します。空の文字列を設定すると、モジュールによって提供されるデフォルトのヘッダが送信されるでしょう。
構文: | fancyindex_ignore string1 [string2 [... stringN]] |
---|---|
デフォルト: | none |
コンテキスト: | http, server, location |
生成されたリストの中に表示したくないファイル名のリストを指定します。NGINXがPCREサポートでビルドされた場合、文字列は正規表現として解釈されます。
構文: | fancyindex_localtime [ on | off ] |
---|---|
デフォルト: | off |
コンテキスト: | http, server, location |
ファイルの時間をローカル時間として表示することを有効にします。デフォルトは"off" (GMT time)です。