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.
The Fancy Index module makes possible the generation of file listings, like the built-in autoindex module does, but adding a touch of style. This is possible because the module allows a certain degree of customization of the generated content:
This module is designed to work with NGINX, a high performance open source web server written by Igor Sysoev.
Note
I have compiled this module with NGINX 1.0.10 on a server running Debian Squeeze - however the README only talks about NGINX 0.8
$ gunzip -c nginx-?.?.?.tar.gz | tar -xvf -
$ git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
--add-module
flag pointing to the directory which contains the source of the fancy indexing module.$ cd nginx-?.?.? $ ./configure --add-module=../ngx-fancyindex [extra desired options]
$ make $ sudo make install
You can test the default built-in style by adding the following lines into a server
section in your NGINX configuration file:
location / {
fancyindex on; # Enable fancy indexes.
fancyindex_exact_size off; # Output human-readable file sizes.
}
Syntax: | fancyindex [on|off] |
---|---|
Default: | off |
Context: | http, server, location |
Enables or disables fancy directory indexes.
Syntax: | fancyindex_css_href uri |
---|---|
Default: | “” |
Context: | http, server, location |
Allows inserting a link to a CSS style sheet in generated listings.
The provided uri parameter will be inserted as-is in a <link>
HTML tag.
The link is inserted after the built-in CSS rules, so you can override the default styles.
Syntax: | fancyindex_exact_size [on|off] |
---|---|
Default: | on |
Context: | http, server, location |
Defines how to represent file sizes in the directory listing; either accurately, or rounding off to the kilobyte, the megabyte and the gigabyte.
Syntax: | fancyindex_header path |
---|---|
Default: | “” |
Context: | http, server, location |
Specifies which file should be inserted at the head of directory listings. If set to an empty string, the default header supplied by the module will be sent.
Syntax: | fancyindex_ignore string1 [string2 [… stringN]] |
---|---|
Default: | none |
Context: | http, server, location |
Specifies a list of file names which will not be shown in generated listings. If NGINX was built with PCRE support strings are interpreted as regular expressions.
Syntax: | fancyindex_localtime [ on | off ] |
---|---|
Default: | off |
Context: | http, server, location |
Enables showing file times as local time. Default is “off” (GMT time).