nginx: index模块和autoindex模块

ngx_http_index_module模块

功能:指定/访问时返回的index文件内容

1.index指令

 语法:index file.....;

默认:index  index.html

放置位置:http,server,location

 

autoindex模块

功能:当URL以/ 结尾是,尝试以html/xml/json/jsonp等格式返回root/alias中指向目录的目录结构

ngx_http_index_module

默认编译进nginx   通过--with-http_autoindex_moudle取消

1.autoindex 指令

语法:autoindex  on | off;

默认:autoindex off;

放置位置 http,server,location

2.autoindex_exact_size  指令; (显示相对路径【字节显示】还是就对路径【单位显示】)

 语法:autoindex_exact_size on | off;

默认:autoindex_exact_size on;

放置位置:http,server,location

3.autoindex_format  指令;      (返回格式)

 语法:autoindex_format  html | xml | json | jsonp;

默认:autoindex_format   html;

放置位置:http,server,location

 

4.autoindex_localtime 指令;(时间是否用本地时间)

 语法:autoindex_localtime on | off;

默认:autoindex_localtime  off;

放置位置:http,server,location

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值