Enable fancyindex for Styled nginx Index Pages

By | 2014/05/06

nginx comes with something called fancyindex to make styled index pages. Check it out!


On Debian or Ubuntu, install the package nginx-extras:

$ sudo apt-get install nginx-extras

In your nginx config, specify fancyindex options like so:

        location / {

                fancyindex on;
                fancyindex_exact_size off;
         }

Here is a screenshot:

fancyindex
If you want to see it in action, checkout: http://scottmillercomposer.com/scores/

8 thoughts on “Enable fancyindex for Styled nginx Index Pages

  1. Erdi

    Please help. I don’t know why, I get an error

    Restarting nginx: nginx: [emerg] unknown directive “fancyindex” in /etc/nginx/sites-enabled/default:31
    nginx: configuration file /etc/nginx/nginx.conf test failed

    Reply
  2. Stanislav

    Yes, I’m using nginx-extras. Ubuntu 14.04

    Reply
    1. Scott Miller Post author

      Hi,

      I just spun up a fresh Ubuntu 14.04 instance on Digital Ocean, did a sudo apt-get update && sudo apt-get upgrade, then sudo apt-get install nginx-extras. I have fancyindex available and working as specifed in the above blog post as a quick test.

      Perhaps start with a fresh instance or fresh image to troubleshoot. Cheers,

      Reply
  3. Axel

    Doesn’t work for me. Nginx was installed with apt and after then, I installed extras, but I get an error message if I restart nginx with the directive.

    location / {

    fancyindex on;
    fancyindex_exact_size off;
    }

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.