🕸️ | Custom autoindex directory listing for nginx [maintainer=@yetimdasturchi]
  • JavaScript 78.8%
  • HTML 20.6%
  • CSS 0.6%
Find a file
Manuchehr Usmonov 9bb5d251ec Updated
2023-02-16 19:43:56 +05:00
.html Added 2023-02-16 19:37:01 +05:00
LICENSE Initial commit 2023-02-16 18:02:17 +05:00
location.config Updated 2023-02-16 19:43:56 +05:00
README.md Updated 2023-02-16 19:43:56 +05:00

oss-autoindex

🕸️ | Custom autoindex directory listing for nginx

Copy .html folder to the folder you want to index and add the location.config file to nginx server.

Sample server:

server{
        listen 80;

        root /media/files;

        server_name _;

        location / {
               try_files $uri $uri/ =404;
               add_before_body /.html/top.html;
               add_after_body /.html/bot.html;
               autoindex on;
               autoindex_localtime on;
               autoindex_exact_size on;
               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;
        }
}