About Blog Current

Fancy Index

Since I am lazy I decided on creating a list of the available blog posts with the autoindex feature of nginx.

This tells Nginx to create a directory view of the specified directory. In my case /blog.

This looks like this:

    location /blog {
        charset UTF-8;
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
        try_files $uri $uri/ =404;

Since this is is turning out to be a pretty important aspect of my blog, I would like the ability to customize this.

Nginx has the fancyindex module for this, which is also available in the Ubuntu 18.04 repository under the name libnginx-mod-http-fancyindex.

After this is installed you simply need to change autoindex to fancyindex and then reload/restart the Nginx server.

This is the view with autoindex:

This is the view with fancyindex (without any actual custom work):