今天來跟大家分享nginx 的cache設定~
下載完nginx之後,
mkdir /var/nginx
mkdir /var/nginx/cache
proxy_cache_path /var/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;
proxy_temp_path
&& use_temp_path=on
啟用臨時目錄proxy_cache_path
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invaild_header updating http_500 http_502 http_503 http_504
這時呼叫看看api ,就會發現/var/nginx/cache/e/d7
底下的檔案中有資料進來