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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                需求,目前的服務器做了nginx的負載均衡,實現目標 請求:http://www.ckl.com/json/rooms/2010101/info.json rewrite:http://test.ckl.tv/room/info/uid/2010101 請求上面的地址,rewrite到一個新的地址并且發往另一組upstream 1.目前配置如下: ``` cat ckl.conf upstream qm_test { server 127.0.0.1:81; keepalive 100; } server { server_name test.ckl.com; access_log /app/local/log/nginx/ckl_access.log main; proxy_headers_hash_max_size 51200; proxy_headers_hash_bucket_size 6400; location / { proxy_pass http://qm_test/; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_connect_timeout 10; proxy_send_timeout 10; proxy_set_header Host $host; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ``` 2.新的配置如下 ``` upstream ckl_backend { server 10.10.1.23:80; keepalive 100; } upstream qm_test { server 127.0.0.1:81; keepalive 100; } server { server_name test.ckl.com; access_log /app/local/log/nginx/ckl_access.log main; proxy_headers_hash_max_size 51200; proxy_headers_hash_bucket_size 6400; #set $proxy_url qm_test; rewrite ^/json/rooms/([^\/]+)/info.json$ /room/info/uid/$1 last; location ~ ^/room/info/uid/([^\/]+)$ { proxy_pass http://ckl_backend; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_connect_timeout 10; proxy_send_timeout 10; proxy_set_header Host $host; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location / { proxy_pass http://qm_test/; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_connect_timeout 10; proxy_send_timeout 10; proxy_set_header Host $host; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ``` 3.測試訪問: ``` 192.168.1.23 - - [03/Jun/2016:14:43:15 +0800] "GET /room/info/uid/2010101 HTTP/1.1" 200 8693 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36" - ``` 發現請求的是/json/rooms/ 跳轉到/room/info/uid/ 請求的upstream http://ckl_backend;
                  <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>

                              哎呀哎呀视频在线观看