nginx索引目录配置

为了简单共享文件,有些人使用svn,有些人使用ftp,但是更多得人使用索引(index)功能。apache得索引功能强大,并且也是最常见得,nginx得auto_index实现得目录索引偏少,而且功能非常简单。先来看看我们得效果图。 [caption id="attachment_2590" align="alignnone" width="524"] nginx auto_index索引效果图 nginx auto_index索引效果图[/caption]  

nginx配置

        location ~ ^/2589(/.*)
        {
                autoindex on; //开启
                autoindex_localtime on;//开启显示功能
        }

auto_index指令

语法:autoindex on | off;
配置段:
autoindex off;
配置段:http, server, location
启用/仅用nginx目录索引功能.  
语法:autoindex_exact_size on | off;
配置段
autoindex_exact_size on;
配置段:http, server, location
制定是否额外得显示文件得大小,单位为字节,mb,gb等等. 默认是打开得  
syntax:autoindex_localtime on | off;
配置段:
autoindex_localtime off;
配置段:http, server, location
指定是否显示目录或者文件得时间,默认是不显示 可以发现nginx的索引功能非常单一,比apache的差远了。有很多nginx的爱好者就看不过去了,开发了一个漂亮的索引插件,名叫fancy index. 请继续关注下节内容 nginx+fancy实现漂亮的索引目录 转载请注明出处:http://www.ttlsa.com/html/2589.html

转载于:https://my.oschina.net/766/blog/211550

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值