May 16

nginx目录浏览第三方插件fancyindex 不指定

碟舞飞扬 , 03:22 , 服务器类 , 评论(0) , 引用(0) , 阅读(8176) , Via 本站原创 | |
nginx添加参数可以允许打开目录浏览功能,详见http://bbs.linuxtone.org/viewthread.php?tid=2563&rpid=9073&ordertype=0&page=1#pid9073或者
官方的 http://wiki.nginx.org/NginxHttpAutoindexModule

这是说的是支持目录浏览的第三方插件fancyindex
本次试验用的nginx-0.8.15
第三方插件下载地址
http://download.snake.de/dist/ngx-fancyindex-0.2.1.tar.bz2

[root@test src]# tar zxvf nginx-0.8.15.tar.gz
[root@test src]# tar jxvf ngx-fancyindex-0.2.1.tar.bz2
[root@test src]# cd nginx-0.8.15
[root@test nginx-0.8.15]# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --add-module=../ngx-fancyindex-0.2.1

然后根据自己的目录浏览要求配置 nginx.conf ,以下为我的主机配置

引用
server {
listen 80;
server_name 192.168.11.12;
location / {
fancyindex on;#开启 fancy indexes
fancyindex_exact_size off;#显示文件大小。
# autoindex on;
#autoindex_localtime on;
#autoindex_exact_size off; 注释这三项是不装插件开启目录浏览功能。
root /data ;
}
}

[root@test nginx]# ./sbin/nginx -t
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@test nginx]# ./sbin/nginx

完成配置。
这里只是用到了插件fancyindex的2个参数,还有 fancyindex_localtimefancyindex_headerfancyindex_footer = 大家研究一下。。可以看一下这里 http://wiki.nginx.org/NginxNgxFancyIndex 。
不知道 安装这个插件与没有安装过插件开启,在效率上是否有不同。。。
下面截图是 安装过插件 和nginx 开启目录浏览 截图。
点击在新窗口中浏览此图片
点击在新窗口中浏览此图片
点击在新窗口中浏览此图片
Tags: ,
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]