nginx功能(1) 目錄配置

2021-07-25 20:46:34 字數 492 閱讀 7755

nginx的功能有很多,就讓我在使用以及學習的的時候,列舉出來吧

首先我們來看看nginx目錄功能

這個功能很簡單,說白了就是,在訪問這個路徑下,就可以當成乙個檔案目錄來使用,autoindex 就是檔案排序,這個需要開啟。然後alias 就是將目錄給出。

autoindex on

; alias /yree/shell/;

autoindex_exact_size off;

#預設為on,顯示出檔案的確切大小,單位是bytes。

#改為off後,顯示出檔案的大概大小,單位是kb或者mb或者gb

autoindex_localtime on

; #預設為off,顯示的檔案時間為gmt時間。

#改為on後,顯示的檔案時間為檔案的伺服器時間

配置 Nginx 的目錄瀏覽功能

nginx 預設是不允許列出整個目錄的,需要配置 nginx 自帶的 ngx http autoindex module 模組實現目錄瀏覽功能 location autoindex exact size off 預設為on,顯示出檔案的確切大小,單位是bytes。改為off後,顯示出檔案的大概大小,...

配置 Nginx 的目錄瀏覽功能

nginx 預設是不允許列出整個目錄的,需要配置 nginx 自帶的 ngx http autoindex module 模組實現目錄瀏覽功能 location autoindex exact size off 預設為on,顯示出檔案的確切大小,單位是bytes。改為off後,顯示出檔案的大概大小,...

nginx 目錄檔案列表功能配置

ngx http autoindex module 此模組用於自動生成目錄列表 ngx http autoindex module只在 ngx http index module模組未找到索引檔案時發出請求.開啟目錄列表功能 1.開啟nginx.conf檔案,在location server或htt...