天天看點

nginx 配置檔案伺服器

server {
    listen       80;
    server_name  localhost;

    autoindex on;
    autoindex_exact_size off;
    autoindex_localtime on;
    charset utf-8;

   --這是linux
    location / {

    root   /mnt/d/TDDownload;
    # C、D盤都在 /mnt 目錄下,這裡是挂載的 D 盤 TDDownload 目錄,

    }
    --這是windows
    location /share{                             #在server下建立一個location
            alias D:\share;             
            autoindex on;                      #開啟自動索引功能,将共享目錄下的檔案整合成頁面
        }
    
}      

繼續閱讀