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