Nginx – Custom autoindex pages with nginx

nginx

Is there a way to define your own autoindex pages in nginx?

I want to add my own HTML and CSS to the generated autoindex pages.

Best Answer

Using XSLT is possible to customize autoindex's xml output using the xslt module:

location / {
    autoindex on;
    autoindex_format xml;
    xslt_stylesheet /path/to/custom.xslt
}

It's what I did on this project: ngx-superbindex