A responsive theme for Nginx Fancyindex module (by @aperezdc).
- Ensure the fancyindex package is built or installed
- Update the nginx configuration with the fancy index flags
- Move the
Nginx-Fancyindex/folder to the root of the site directory as defined in the nginx configuration. - Restart/reload nginx.
- RPM on EPEL 9: https://rhel.pkgs.org/9/epel-x86_64/nginx-mod-fancyindex-0.5.2-3.el9.x86_64.rpm.html
- Building from source: https://github.com/aperezdc/ngx-fancyindex?tab=readme-ov-file#building
...
http {
...
server {
listen 80;
server_name X.X.X.X;
root /var/www/html;
# Serve content from /share
location ^~ / {
fancyindex on;
fancyindex_localtime on;
fancyindex_exact_size off;
fancyindex_header "/Nginx-Fancyindex/header.html";
fancyindex_footer "/Nginx-Fancyindex/footer.html";
fancyindex_name_length 255;
...
}
}
}
# on Fedora-based OS (RHEL/CentOS/Rocky)
dnf install nginx-mod-fancyindex
nano /etc/nginx/nginx.conf
mv ./Nginx-Fancyindex /var/www/html/
# restorecon -Rv /var/www/html/
nginx -s reload
# OR: systemctl restart nginx.serviceA standard configuration looks something like this:
fancyindex on;
fancyindex_localtime on;
fancyindex_exact_size off;
fancyindex_header "/Nginx-Fancyindex/header.html";
fancyindex_footer "/Nginx-Fancyindex/footer.html";
# Ignored files will not show up in the directory listing, but will still be public.
fancyindex_ignore "examplefile.html";
# Making sure folder where these files are do not show up in the listing.
fancyindex_ignore "Nginx-Fancyindex";addNginxFancyIndexForm.jsenhances the listing with search filtering, persistent theme selection, and dark-mode responsiveness.jquery.min.jsbundles jQuery 2.1.0 for DOM querying, event handling, and AJAX utilities used across the page.showdown.min.jsprovides the Showdown Markdown-to-HTML converter leveraged when loading optional documentation files



