README.md

Fancy autoindex for nginx

  • Clone or download & unpack this repository.
  • Create touch.png & favicon.ico files in document-root if they don’t exist.
  • Create in document-root folder autoindex & copy there all files from repository; or create in document-root symlink named autoindex pointing to this repository: cd document-root && ln -s path-to-repositories/fancy-autoindex autoindex.
  • Go to this folder & create there symlinks pointing to mime.types & icons (see below).
  • Install required components (see below).
  • For selected nginx virtual host and/or location add directives to create autoindex (see below). Instead of inserting all these directives, you can limit yourself to one - include document-root/autoindex/nginx.conf; - by adding it to the required server or location blocks.
  • Restart nginx: sudo /etc/init.d/nginx restart.

screenshot

symlinks

  • mime.types -> /etc/nginx/mime.types
  • mimetypes -> /usr/share/icons/Faenza/mimetypes/scalable
  • parent.svg -> /usr/share/icons/Faenza/actions/scalable/back.svg
  • folder.svg -> /usr/share/icons/Faenza/places/scalable/folder-open.svg

Create them with command: ln -s source-file-or-folder target-name. This can be done automatically with command make symlinks. Instead of Faenza you can use some other icons style from folder /usr/share/icons/.

components

Must be downloaded manually or installed using bower or node.js. By default, it is placed in the document-root/components folder. If some other folder is used (document-root/bower_components or document-root/node_modules), you need to fix it in document-root/autoindex/header.html.

nginx.conf

server {
    /* … */

	autoindex on;
	autoindex_localtime on;
	autoindex_exact_size on;
	add_before_body /autoindex/header.html;
	add_after_body /autoindex/footer.html;
	sub_filter '<html>' '';
	sub_filter '<head><title>Index of $uri</title></head>' '';
	sub_filter '<body bgcolor="white">' '';
	sub_filter '</body>' '';
	sub_filter '</html>' '';
	sub_filter_once on;

    /* … */
}
Описание

Fancy autoindex for nginx

Конвейеры
0 успешных
0 с ошибкой