教程 Fancyindex 美丽的autoindex

frankniubi

大佬在此
管理成员
很多朋友都觉得AutoIndex实在是过于丑陋, 看不下去了怎么办?
今天给大家推荐 FancyIndex!!!
项目地址: https://github.com/aperezdc/ngx-fancyindex

在美化之前,需要安装Nginx FancyIndex模块。安装模块步骤如下。

查看Nginx当前编译了哪些模块
要查看Nginx编译了哪些模块,执行以下命令:2>&1 nginx -V | tr ' ' '\n'|grep module,如下
查看完整的编译参数:nginx -V,如下:

nginx config

内容如下:
nginx version: nginx/1.13.8
built by clang 9.0.0 (clang-900.0.39.2)
built with OpenSSL 1.1.0f 25 May 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre --sbin-path=/usr/local/nginx/bin/nginx --with-cc-opt='-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include' --with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl@1.1/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module --with-http_v2_module


动态编译添加Nginx模块
  1. 在GitHub下载最新源码:ngx-fancyindex
  2. 源码下载下来后,解压,放到nginx源码目录(/usr/local/nginx)中,执行下面的代码,编译:
    ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre --sbin-path=/usr/local/nginx/bin/nginx --with-cc-opt='-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include' --with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl@1.1/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module --with-http_v2_module --add-module=ngx-fancyindex-0.4.2

  3. make 这里不要make install!!!
  4. 进入nginx源码目录下的objs目录,执行2>&1 ./nginx -V | tr ' ' '\n'|grep fan
  5. 用objs目录下的nginx文件替换/usr/bin下面的nginx即可
选择Fancy Index主题
在Github里面找到了两个开源的主题,分别是:

大家选一个自己喜欢的就好了,这里我选的是第一个。

但是在实际使用过程中,第一个代码有一些问题,我做了一些修改,想要直接可以使用的,可以用这个:https://github.com/lanffy/Nginx-Fancyindex-Theme

Fancy Index 配置
  1. 进入Nginx安装的web目录,执行nginx -V,输出configure arguments: --prefix=/usr/local/nginx,就是这个目录
  2. git clone https://github.com/lanffy/Nginx-Fancyindex-Theme.git
  3. 在nginx location模块中添加Fancy Index配置,如下:
    location /download
    {
    include /usr/local/nginx/html/Nginx-Fancyindex-Theme/fancyindex.conf; # 目录美化配置
    root /home/map/www/; #指定目录所在路径
    autoindex on; #开启目录浏览
    autoindex_format html; #以html风格将目录展示在浏览器中
    autoindex_exact_size off; #切换为 off 后,以可读的方式显示文件大小,单位为 KB、MB 或者 GB
    autoindex_localtime on; #以服务器的文件时间作为显示的时间
    charset utf-8,gbk; #展示中文文件名
    }


  4. 重启Nginx即可
 

adosazufaho

New member
Many oqv.wrfd.mcbar.cn.zjs.bc signifies isolate retin a without a prescription metaspray nasal spray online canada propecia for sale generic geodon from canada cheap 10mg prasugrel online prasugrel generic vintor shipping brand kamagra generic fildena lowest price zoloft differin on internet cheap cleocin pills buying generic midamor flomax generic viagra jelly from canada prednisone flagyl er without a prescription hydroxychloroquine price at walmart sublingual cialis information sublingual cialis imusporin prices lasix in usa online ginette 35 no prescription generic ginette 35 buy prednisone 10 mg anabrez capsules for sale anabrez en ligne virility pills discount drugs adalat 20mg lowest price viprogra lowest price viprogra 4 mg generic periactin pills fulvicin generic cialis 20 mg buying levitra tadalafil low cost isotretinoin best price for cialis how to buy cialis online doxylab best price ketotifen order yaz order yaz lowest dose etodolac etodolac galvus inviting joint, <a href="https://fontanellabenevento.com/buy-retin-a-w-not-prescription/">retin a.com</a> <a href="https://carnegiemarketing.com/metaspray-nasal-spray/">metaspray nasal spray</a> <a href="https://propeciaonlinecheapestprice.com/">propecia on line</a> propecia on line <a href="https://carnegiemarketing.com/geodon/">low price geodon</a> geodon on internet <a href="https://petermillerfineart.com/product/prasugrel/">no prescription prasugrel</a> <a href="https://tacticaltrappingservices.com/item/vintor/">vintor generic lowest price</a> <a href="https://tacticaltrappingservices.com/brand-kamagra/">brand kamagra</a> <a href="https://midsouthprc.org/drug/fildena/">cheapest fildena</a> <a href="https://coastal-ims.com/drug/zoloft/">buy sertraline online</a> <a href="https://lilliputsurgery.com/product/differin/">differin</a> <a href="https://fairbusinessgoodwillappraisal.com/product/cleocin/">cleocin overnight</a> <a href="https://carnegiemarketing.com/midamor/">order now midamor</a> <a href="https://mywyomingstore.com/item/flomax/">cheapest 0.2 mg flomax canada</a> <a href="https://frankfortamerican.com/viagra-jelly/">viagra jelly</a> <a href="https://center4family.com/prednisone-no-prescription/">buy prednisone</a> prednisone without dr prescription <a href="https://cubscoutpack152.org/flagyl-er/">flagyl er</a> <a href="https://advantagecarpetca.com/hydroxychloroquine/">hydroxychloroquine</a> <a href="https://darlenesgiftshop.com/item/sublingual-cialis/">sublingual cialis without prescription</a> <a href="https://andrealangforddesigns.com/drugs/imusporin/">imusporin 100 best price usa</a> <a href="https://columbiainnastoria.com/drugs/generic-lasix-canada/">generic lasix canada</a> <a href="https://alliedentinc.com/ginette-35/">generic ginette 35</a> ginette 35 <a href="https://recipiy.com/prednisone/">prednisone without prescription</a> <a href="https://pureelegance-decor.com/anabrez/">www.anabrez.com</a> <a href="https://petralovecoach.com/virility-pills/">generic virility pills canada pharmacy</a> <a href="https://the7upexperience.com/drug/adalat/">adalat cost uk</a> <a href="https://endmedicaldebt.com/viprogra/">canada medication viprogra</a> <a href="https://comicshopservices.com/periactin/">periactin 4 mg canada</a> <a href="https://petermillerfineart.com/item/fulvicin/">fulvicin</a> <a href="https://center4family.com/buy-cialis-online/">generic cialis at walmart</a> <a href="https://oliveogrill.com/cheap-levitra/">discount levitra</a> <a href="https://advantagecarpetca.com/tadalafil/">tadalafil</a> <a href="https://driverstestingmi.com/isotretinoin/">buy cheap isotretinoin</a> <a href="https://happytrailsforever.com/cialis/">cialis</a> <a href="https://oliveogrill.com/tadalafil-20-mg/">cialis</a> <a href="https://mywyomingstore.com/item/doxylab/">low cost doxylab</a> <a href="https://andrealangforddesigns.com/drugs/ketotifen/">ketotifen</a> <a href="https://carnegiemarketing.com/yaz/">cheap yaz</a> <a href="https://downtowndrugofhillsboro.com/etodolac/">canada etodolac</a> <a href="https://sjsbrookfield.org/galvus/">galvus</a> regrets whey:casein correctly https://fontanellabenevento.com/buy-retin-a-w-not-prescription/ retin a https://carnegiemarketing.com/metaspray-nasal-spray/ metaspray nasal spray in usa https://propeciaonlinecheapestprice.com/ buy propecia online cheap https://carnegiemarketing.com/geodon/ cheapest geodon dosage price https://petermillerfineart.com/product/prasugrel/ generic prasugrel lowest price https://tacticaltrappingservices.com/item/vintor/ vintor commercial https://tacticaltrappingservices.com/brand-kamagra/ mail order brand kamagra https://midsouthprc.org/drug/fildena/ generic fildena lowest price https://coastal-ims.com/drug/zoloft/ zoloft 50mg https://lilliputsurgery.com/product/differin/ safest online for generic differin https://fairbusinessgoodwillappraisal.com/product/cleocin/ cleocin https://carnegiemarketing.com/midamor/ midamor buy generic midamor https://mywyomingstore.com/item/flomax/ indian flomax 0.4 https://frankfortamerican.com/viagra-jelly/ viagra jelly https://center4family.com/prednisone-no-prescription/ prednisone without a prescription https://cubscoutpack152.org/flagyl-er/ online flagyl er no prescription https://advantagecarpetca.com/hydroxychloroquine/ hydroxychloroquine price at walmart https://darlenesgiftshop.com/item/sublingual-cialis/ oklahoma city sublingual-cialis https://andrealangforddesigns.com/drugs/imusporin/ imusporin https://columbiainnastoria.com/drugs/generic-lasix-canada/ lowest price lasix https://alliedentinc.com/ginette-35/ generic ginette 35 https://recipiy.com/prednisone/ prednisone tablets https://pureelegance-decor.com/anabrez/ low cost anabrez anabrez https://petralovecoach.com/virility-pills/ generic virility pills from canada www.virility pills.com https://the7upexperience.com/drug/adalat/ buy adalat online legitimate pharmacy https://endmedicaldebt.com/viprogra/ viprogra https://comicshopservices.com/periactin/ periactin https://petermillerfineart.com/item/fulvicin/ fulvicin no prescription no prescription fulvicin https://center4family.com/buy-cialis-online/ cialis 20 mg best price https://oliveogrill.com/cheap-levitra/ levitra samples https://advantagecarpetca.com/tadalafil/ tadalafil aus deutschland https://driverstestingmi.com/isotretinoin/ generic isotretinoin in canada https://happytrailsforever.com/cialis/ cialis in england https://oliveogrill.com/tadalafil-20-mg/ cialis blood pressure https://mywyomingstore.com/item/doxylab/ doxylab on internet https://andrealangforddesigns.com/drugs/ketotifen/ canadian pharmacy ketotifen https://carnegiemarketing.com/yaz/ yaz https://downtowndrugofhillsboro.com/etodolac/ achat etodolac 300 mg https://sjsbrookfield.org/galvus/ order galvus 50mg fibre, bodies, examination; incontinence.
 
顶部