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

相关文章:

  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2021-05-16
  • 2022-12-23
  • 2022-01-06
  • 2022-01-29
相关资源
相似解决方案