資料:
實例:修改靜態HTML文件,查看網頁返回304 Not Modified,服務器上文件已經做了修改,緩存沒有被更新,需要返回200狀態碼
www.xiangcloud.com.cn/market.html
瀏覽器端If-Modified-Since 和 服務器端Last-Modified 時間一樣 顯示304 內容無修改,Response Headers 項Cache-Control:max-age=2592000
在瀏覽器端 Request Headers 項 Cache-Control:max-age=0
配置nginx 緩存 使用expires:-1不使用緩存
查詢配置文件 find / -name nginx.conf
找到靜態文件配置(vi命名 i - 修改 - esc - : - wq 回車 )
查詢nginx啟動文件路徑 find / -name nginx
cd /usr/sbin
平滑重啟nginx
./nginx -s reload
測試配置文件是否正確
./nginx -t
查看nginx 啟動路徑和配置文件路徑
ps aux | grep nginx