nginx 开启 autoindex


nginx autoindex 展示文件索引目录

autoindex 用于文件目录的展示,配置非常简单,但是千万不要暴露敏感信息,官方文档地址 http://nginx.org/en/docs/http/ngx_http_autoindex_module.html。

配置

location /docs {
  index a.html; 
  autoindex on;
  autoindex_exact_size on;
  autoindex_localtime on;
  root /Users/arraybuffer/Desktop/html;
  
  # 目前还不了解原因,这里需要配置一个不存在的路径,否则会直接访问默认文件 index.html
  index not_exist;
}

参考文档

  1. http://nginx.org/en/docs/http/ngx_http_autoindex_module.html
  2. https://blog.csdn.net/qq_34556414/article/details/105947120


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM