Go to file
Adrian Perez fd3950172a Merge pull request #4 from davidjb/master
Ensure correct 200 status is sent to clients on successful listing
2013-04-22 04:56:57 -07:00
.gitignore Update README file, add .gitignore 2010-06-10 01:49:30 +02:00
.todo Merged support for nginx 0.8 2009-06-07 06:50:30 +02:00
HACKING.rst Add note on gawk requisite 2008-09-11 19:55:34 +02:00
LICENSE new templates are arriving 2007-08-22 21:27:11 +02:00
README.rst Update README with some bits 2012-01-18 00:31:22 +02:00
config Fixed issue with non-bash shells being unable of configuring the module. 2007-09-28 23:01:28 +02:00
nginx-0.6-support.patch Add patch for nginx 0.6 2008-12-10 02:34:30 +01:00
ngx_http_fancyindex_module.c Ensure fancyindex is sending NGX_HTTP_OK (200) as the status vs HTTP_OK which is 0. Without this, connections sit waiting forever. 2013-04-19 11:10:44 +10:00
template.awk Update e-mail address and copyright headers 2011-04-03 00:22:59 +03:00
template.h Add fancyindex_css_href configuration option 2010-06-10 16:56:31 +02:00
template.html Add fancyindex_css_href configuration option 2010-06-10 16:56:31 +02:00

README.rst

========================
Nginx Fancy Index module
========================

.. contents::

The Fancy Index module makes possible the generation of file listings, like
the built-in `autoindex <http://wiki.nginx.org/NginxHttpAutoindexModule>`__
module does, but adding a touch of style. This is possible because the module
module allows a certain degree of customization of the generated content:

* Custom headers. Either local or stored remotely.
* Custom footers. Either local or stored remotely.
* Add you own CSS style rules.

This module is designed to work with Nginx_, a high performance open source web
server written by `Igor Sysoev <http://sysoev.ru>`__.


Requirements
============

You will need the sources for Nginx_. Any version starting from the 0.7
series onwards will work.  Note that the modules *might* compile with
versions in the 0.6 series by applying ``nginx-0.6-support.patch``, but this
is unsupported (YMMV).


Building
========

1. Unpack the Nginx_ sources::

    $ gunzip -c nginx-?.?.?.tar.gz | tar -xvf -

2. Unpack the sources for the fancy indexing module::

    $ gunzip -c nginx-fancyindex-?.?.?.tar.gz | tar -xvf -

3. Change to the directory which contains the Nginx_ sources, run the
   configuration script with the desired options and be sure to put an
   ``--add-module`` flag pointing to the directory which contains the source
   of the fancy indexing module::

    $ cd nginx-?.?.?
    $ ./configure --add-module=../nginx-fancyindex-?.?.?  [extra desired options]

4. Build and install the software::

    $ make

   And then, as ``root``::

    # make install

5. Configure Nginx_ by using the modules' configuration directives_.


Example
=======

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.
  }


Directives
==========

fancyindex
~~~~~~~~~~
:Syntax: *fancyindex* [*on* | *off*]
:Default: fancyindex off
:Context: http, server, location
:Description:
  Enables or disables fancy directory indexes.

fancyindex_css_href
~~~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_css_href uri*
:Default: fancyindex_css_href ""
:Context: http, server, location
:Description:
  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.

fancyindex_exact_size
~~~~~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_exact_size* [*on* | *off*]
:Default: fancyindex_exact_size on
:Context: http, server, location
:Description:
  Defines how to represent file sizes in the directory listing; either
  accurately, or rounding off to the kilobyte, the megabyte and the
  gigabyte.

fancyindex_footer
~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_footer path*
:Default: fancyindex_footer ""
:Context: http, server, location
:Description:
  Specifies which file should be inserted at the foot of directory listings.
  If set to an empty string, the default footer supplied by the module will
  be sent.

.. warning:: When inserting custom header/footer a subrequest will be
   issued so potentially any URL can be used as source for them. Although it
   will work with external URLs, only using internal ones is supported.
   External URLs are totally untested and using them will make Nginx_ block
   while waiting for the subrequest to complete. If you feel like external
   header/footer is a must-have for you, please
   `let me know <mailto:aperez@igalia.com>`__.

fancyindex_header
~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_header path*
:Default: fancyindex_header ""
:Context: http, server, location
:Description:
  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.

fancyindex_ignore
~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_ignore string1 [string2 [... stringN]]*
:Default: No default.
:Context: http, server, location
:Description:
  Specifies a list of file names which will be not be shown in generated
  listings. If Nginx was built with PCRE support strings are interpreted as
  regular expressions.

fancyindex_localtime
~~~~~~~~~~~~~~~~~~~~
:Syntax: *fancyindex_localtime* [*on* | *off*]
:Default: fancyindex_localtime off
:Context: http, server, location
:Description:
  Enables showing file times as local time. Default is “off” (GMT time).

.. _nginx: http://nginx.net

.. vim:ft=rst:spell:spelllang=en: