nginx安装Fancy美化索引目录

参考文档:官方帮助

[[email protected] home]# wget http://nginx.org/download/nginx-1.10.1.tar.gz
[[email protected] home]# git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
[[email protected] home]# gunzip -c nginx-1.10.1.tar.gz | tar -xvf -
[[email protected] home]# cd nginx-1.10.1
[[email protected] nginx-1.10.1]# ./configure --prefix=/usr/local/nginx/ --add-module=../ngx-fancyindex
[[email protected] nginx-1.10.1]# make & make install
[[email protected] nginx-1.10.1]# vim /usr/local/nginx/conf/vhost/dl.lianst.com.conf
  .....
   	 location / {
                fancyindex on;               # 开启fancy目录索引 
                fancyindex_exact_size off;   # 不使用精确大小.
                fancyindex_localtime on;     #使用本地时间
                #fancyindex_header ".heard.html";    #使用.heard.html作为头部文件,没有这个文件将会出现404错误.
                fancyindex_footer "/.footer.html";   #使用.footer.html作为底部文件,没有这个文件将会出现404错误.
                #fancyindex_css_href "fancyindex/css";
        }

[[email protected] nginx-1.10.1]# lnmp restart

效果如下:

nginx安装Fancy美化索引目录