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
nginx with the xslt module (included by default on Ubuntu packages).
- 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.
-
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
-
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'; }
-
Restart nginx with
systemctl restart nginx
and voilà!