在 nginx 顯示某個目錄檔案的設定已經做很久了,但遲遲卻沒有發現檔案日期不一樣的這個問題(差了八小時),呵!
參考:GitHub lixingcong
依照文章進行下列的設定:
location /download { autoindex on; # set to on means use localtime autoindex_localtime on; # show size with unit 'MB' instead of 'Byte' autoindex_exact_size off; }
在對 nginx 服務做重載的動作後,就可以生效了。順便也把檔案大小的顯示改成 human-readable,呵!1.3GB 變成 1GB,感覺沒有很精準,嘿!
一開始還找錯解決的方法,所以要記錄一下囉!
20240402
文章標籤
全站熱搜