nginx+fancyindex实现漂亮的目录索引

nginx-fancy-index

官网:

https://www.nginx.com/resources/wiki/modules/fancy_index/

解压缩 Nginx 源码包

tar zxf nginx-?.?.?.tar.gz

下载 FancyIndex

$ git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex

编译安装 Nginx

$ cd nginx-?.?.?
$ ./configure --add-module=../ngx-fancyindex  [extra desired options] # 此处可写绝对路径

开启 FancyIndex

location / {
  fancyindex on;              # Enable fancy indexes.
  fancyindex_exact_size off;  # Output human-readable file sizes.
}