<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] # 配置 ~~~ include mime.types; #文件名與文件擴展名映射表 default_type application/octet-stream; #默認文件類型,默認為text/plain #access_log off; #取消服務日志 log_format myFormat ' $remote_addr–$remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for'; #自定義格式 access_log log/access.log myFormat; #combined為日志格式的默認值 sendfile on; #允許sendfile方式傳輸文件,默認為off,可以在http塊,server塊,location塊。 sendfile_max_chunk 100k; #每個進程每次調用傳輸數量不能大于的值,默認為0,即不設上限 keepalive_timeout 65; #連接超時時間,默認為75sf,可以在http塊,server塊,location塊。 proxy_connect_timeout 1; #nginx與被代理服務器建立連接的超時時間,默認60秒 proxy_read_timeout 1; #nginx服務器向被代理服務器發出read請求后,等待響應的超時時間,默認為60秒 proxy_send_timeout 1; #nginx服務器向被代理服務器發出write請求后,等待響應的超時時間,默認為60秒 proxy_ignore_client_abort on; #客戶端斷網時,nginx服務器是否中斷被代理服務器的請求,默認為off proxy_method get; #接受客戶端的請求方法post/get proxy_http_version 1.0 ; #Nginx服務器提供代理服務器的http協議版本為1.0,1.1,默認設置為1.0 proxy_ignore_client_abort on; #客戶端斷網時,nginx服務器是否中斷被代理服務器的請求,默認為off proxy_ignore_headers "Expires" "Set-Cookie"; #nginx服務器不處理設置的http響應頭中的頭域,空格隔開可以設置多個 proxy_intercept_errors on; #如果被代理服務器返回的狀態碼為4xx,設置的error_page會生效,默認為off proxy_headers_hash_max_size 1024; #存放http報文頭的哈希表容量上限,默認為512個字符 proxy_headers_hash_bucket_size 128; #nginx服務器申請存放http報文頭的哈希表容量大小。默認為64個字符 proxy_next_upstream timeout; #反向代理upstream中設置的服務器組,出現故障時,被代理服務器返回的狀態值 error|timeout|invalid_header|http_500|http_502|http_503|http_504|http_404|off ~~~ # 錯誤頁 設置錯誤頁 ~~~ error_page 404 https://www.baidu.com; #錯誤頁 ~~~ <br> 這個配置并沒有起作用,需要配合以下配置使用 ~~~ #如果被代理服務器返回的狀態碼為4xx,設置的error_page會生效,默認為off proxy_intercept_errors on; ~~~ <br> 如果我們的代理只允許接受get,post請求方法的一種 ~~~ proxy_method get; #接受客戶端的請求方法post/get ~~~ <br> 設置支持的http協議版本 ~~~ proxy_http_version 1.0 ; #Nginx服務器提供代理服務器的http協議版本為1.0,1.1,默認設置為1.0 ~~~ <br> <br> # 負載均衡 如果你的nginx服務器給2臺web服務器做代理,負載均衡算法采用輪詢,那么當你的一臺web服務器iis關閉,也就是web不能訪問,那么nginx服務器分發請求還是會給這臺不能訪問的服務器,如果這里的響應連接時間過長,會導致客戶端頁面一直等待響應。 ![](https://box.kancloud.cn/f9e85fc2fb4ed92ecfe3307fbd513066_909x339.png) <br> 如果負載均衡中web2發生這樣的情況,nginx首先回去web1請求,但nginx在配置不當的情況下回繼續分發請求到web2,然后等待web2響應,直到我們的響應時間超時,才會把請求重新分發給web1,這里的響應時間如果過長,用戶等待的時間就會越長。 <br> 以下配置是解決方案之一 ~~~ proxy_connect_timeout 1; #nginx與被代理服務器建立連接的超時時間,默認60秒 proxy_read_timeout 1; #nginx服務器向被代理服務器發出read請求后,等待響應的超時時間,默認為60秒 proxy_send_timeout 1; #nginx服務器向被代理服務器發出write請求后,等待響應的超時時間,默認為60秒 proxy_ignore_client_abort on; #客戶端斷網時,nginx服務器是否中斷被代理服務器的請求,默認為off ~~~ <br> 如果使用upstream指令配置了一組服務器作為被代理服務器,服務器中的訪問算法遵循配置的負載均衡規則,同時可以使用該指令配置在發生哪些異常情況時,將請求順次交給下一組服務器處理。 ~~~ proxy_next_upstream timeout; #反向代理upstream中設置的服務器組,出現故障時,被代理服務器返回的狀態值 error|timeout|invalid_header|http_500|http_502|http_503|http_504|http_404|off ~~~ * error:建立連接或者向被代理的服務器發送請求或讀取響應信息時服務器發生錯誤 * timeout:建立連接,向被代理服務器發送請求或讀取響應信息時服務器發生超時 * invalid_header:被代理服務器返回的響應頭異常 * off:無法將請求分發給被代理服務器 * http_400, ...:被代理服務器返回的狀態碼為400,500,502等 <br>
                  <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>

                              哎呀哎呀视频在线观看