<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 示例 上游服務器: ``` server { listen 8081; add_header X-Accel-Expires 5; //上游服務器告訴代理服務器,緩存的內容5秒后失效; location / { root html/8081; //路徑下有index.html,內容是8081 } } server { listen 8082; location / { root html/8082; //路徑下有index.html,內容是8082 } } ``` 代理服務器: ``` proxy_cache_path test_cache_path levels=2:2 keys_zone=cache_zone:30m max_size=32g inactive=50m use_temp_path=off; upstream back_end { server 192.168.33.10:8081; server 192.168.33.10:8082; } server { listen 80; server_name website.com; charset utf-8; root html; location / { #proxy_cache cache_zone; //引用上面定義的緩存 #proxy_cache_valid 200 5m; #add_header Nginx-Cache-Status "$upstream_cache_status"; // $upstream_cache_status變量由代理服務器 返回給客戶端,里面可以查看緩存命中情況 proxy_pass http://back_end; } } ``` 結果:在不開啟緩存的情況下,會輪詢的訪問上游服務器,并返回其結果: ``` curl website.com/index.html 8081 curl website.com/index.html 8082 curl website.com/index.html 8081 curl website.com/index.html 8082 ``` 將注釋去掉,并訪問: 第一次: 顯示未命中緩存; ``` 8081 ``` ![](https://img.kancloud.cn/97/b9/97b9dd6f02e026c53431165c96054bb8_1058x696.png) 第二次:顯示命中緩存,并還是返回8081,這說明nginx直接返回了緩存,沒有去請求上游服務器; ![](https://img.kancloud.cn/a8/b0/a8b02dd4a22f80df7e433a026a1391bc_1022x610.png) 第三次:等待5秒后再訪問: ![](https://img.kancloud.cn/3e/8d/3e8d461da1dfb5431603bf2fff44baeb_940x674.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看