重识Nginx - 08 使用ngx_http_autoindex_module实现目录浏览功能
文章目录
ngx_http_autoindex_module
https://nginx.org/en/docs/http/ngx_http_autoindex_module.html
配置
Example Configuration
location / {
autoindex on;
}
autoindex
Syntax: autoindex on | off;
Default:
autoindex off;
Context: http, server, location
Enables or disables the directory listing output.
autoindex on; 设置为on目录是可以访问的 autoindex off; 设置为off目录禁止访问,里面具体内容是可以访问的。
autoindex_exact_size
autoindex_exact_size off; 默认为on,显示出文件的确切大小,单位是bytes。 改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
Syntax: autoindex_exact_size on | off;
Default:
autoindex_exact_size on;
Context: http, server, location
For the HTML format, specifies whether exact file sizes should be output in the directory listing, or rather rounded to kilobytes, megabytes, and gigabytes.
autoindex_localtime
autoindex_localtime on; 默认为off,显示的文件时间为GMT时间。 改为on后,显示的文件时间为文件的服务器时间
Syntax: autoindex_localtime on | off;
Default:
autoindex_localtime off;
Context: http, server, location
For the HTML format, specifies whether times in the directory listing should be output in the local time zone or UTC.
autoindex_format
Syntax: autoindex_format html | xml | json | jsonp;
Default:
autoindex_format html;
Context: http, server, location
This directive appeared in version 1.7.9.
Sets the format of a directory listing.
When the JSONP format is used, the name of a callback function is set with the callback request argument. If the argument is missing or has an empty value, then the JSON format is used.
实操
访问
相关文章
- 一次nginx返回422状态码的经历
- 第七章·Logstash深入-收集NGINX日志
- SecureCRT中文乱码,导致上传到nginx上的文件乱码,访问报404「建议收藏」
- 2.Nginx进阶学习之最佳配置实践指南
- Nginx日志分析工具goaccess
- scrapy/nginx 服务带有http 验证,怎样使用curl 请求详解程序员
- MySQL与Nginx实现高性能的网络连接(mysql连接nginx)
- Linux下如何快速删除Nginx(linux删除nginx)
- Linux安装Nginx:一步一步指南(linux下载nginx)
- Nginx网站架构实战——14、反向代理实现nginx+apache动静分离
- Nginx网站架构实战——09、编译PHP并与nginx整合
- Nginx HTTP负载均衡和反向代理配置
- 《Nginx官方文档》如何安装nginx
- 模块Nginx安装Redis模块:快速上手(nginx安装redis)
- HTTP请求在Linux下的实现(http请求linux)
- nginx秒杀科技Redis与Nginx结合的方案(秒杀技术方案redis和)
- 使用Nginx反向代理与proxy_cache缓存搭建CDN服务器的配置方法
- 制作nginx的RPM包教程