XSLT template for Nginx AutoIndex Pages
# nginx.conf
load_module modules/ngx_http_xslt_filter_module.so;
server {
location / {
root /mnt;
autoindex on;
autoindex_format xml;
xslt_stylesheet /path/to/template.xslt;
xslt_string_param path $uri;
}
# or
location /abc/ {
autoindex on;
autoindex_format xml;
xslt_stylesheet /path/to/template.xslt;
xslt_string_param path $uri;
xslt_string_param root /abc/; # same as location
}
}
- Dark mode
- BreadCumbs
- i18n support
Parameter lang:
- default: 'en-us'
- enum: ['zh-cn', 'en-us']
You can add more languages on 'template.xslt'.
# nginx.conf
server {
location / {
...
xslt_string_param lang 'zh-cn';
}
}
- Mobile friendly
- Remove all Javascript
- Symbol link support
This work is based upon: