Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.43 KB

README.md

File metadata and controls

32 lines (20 loc) · 1.43 KB

ngx-niceindex

Customizable directory indexes for nginx without index modules

A directory indexer for nginx built to be simple, lightweight and easy to customize. It doesn't require indexer modules. It relies on xslt and css to generate clean html. It borrows heavily from nginx-indexer, ngx-superbindex and wilhelmy/dirlist.xslt

Requirements

nginx with the xslt module (included by default on Ubuntu packages).

Caveats

  • When nginx outputs autoindex data in xml, dates are GMT. There is no easy way to convert dates to local time in xslt1 and without additional packages.

Usage

  1. Clone the repository into a hidden .niceindex folder in the directory you want to list:

    git clone https://github.com/reven/ngx-niceindex.git .niceindex

  2. Add the following lines to the corresponding location in your nginx.conf file:

    location / {
        autoindex on;
        autoindex_format xml;
    
        xslt_stylesheet /path/to/your/directory/.niceindex/niceindex.xslt path='$uri';
    }
  3. Restart nginx with systemctl restart nginx and voilà!

ngx-niceindex_screenshot