nginx proxy_cache配置說明 nginx proxy cache nginx tcp proxy nginx proxy pass配

來源:互聯網
上載者:User
#定義代理緩衝路徑 ,快取檔案儲存路徑 緩衝初始大小和最大值 緩衝時間

proxy_cache_path d:\code\cache levels=1:2 keys_z max_size=20m inactive=1m;


location / {

#配置上面定義的keys_zone的值
proxy_cache cache1;

#配置url中包括哪個參數的時候不去緩衝中查詢
proxy_cache_bypass $arg_name;

#定義緩衝的key
proxy_cache_key $host$uri$is_args$args;

#緩衝時間,如果response中header資訊裡邊有Cache-Control 則以header裡邊的緩衝時間為準
proxy_cache_valid 2m;

#當緩衝失效後回源出錯的時候可以使用緩衝中舊資料,舊的總比出錯強
proxy_cache_use_stale error timeout http_502 http_404;
proxy_pass http://127.0.0.1:8080;
}

以上就介紹了nginx proxy_cache配置說明,包括了proxy,nginx方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.