L50※开启nginx浏览目录及美化

1> 下载fancyindex模块

cd /usr/local
wget https://hub.condor.vip/ngx-fancyindex/ngx-fancyindex-0.5.2.tar.xz
tar xvf ngx-fancyindex-0.5.2.tar.xz

2> 重新编译nginx

添加ngx-fancyindx模块

./configure --prefix=/usr/local/nginx --user=www --add-module=/usr/local/nginx-rtmp-module --add-module=/usr/local/ngx-fancyindex-0.5.2 --group=www --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-stream --with-stream_ssl_preread_module --with-stream_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-1.1.1q --with-pcre=../pcre-8.45 --with-pcre-jit --with-ld-opt=-ljemalloc
make && make install

3> 下载主题

cd /usr/local/nginx/html
git clone https://github.com/lanffy/Nginx-Fancyindex-Theme

4> 修改nginx配置

location /{
    include /usr/local/nginx/html/Nginx-Fancyindex-Theme/fancyindex.conf;
    root /data/share/;
    autoindex on;
    autoindex_format html;
    autoindex_exact_size off;
    autoindex_localtime on;
    charset utf-8,gbk;
  }

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享