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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 上傳和訪問資源池分離 [TOC] ## 一、需求梳理: **1.需求** * 當用戶請求`www.etiantian.org/upload/xx `地址時,實現由upload上傳服務器池處理請求。 * 當用戶請求`www.etiantian.org/static/xx` 地址時,實現由靜態服務器池處理請求。 * 除此以外,對于其他訪問請求,全都由默認的動態服務器池處理請求。 **2.資源池** |用戶請求[URI]|處理請求服務器|站點目錄|功能| | --- | --- | --- | --- | |/upload|10.0.0.8:80|html/www/upload|upload服務器| |/static|10.0.0.7:80|html/www/static|static靜態服務器| |/|10.0.0.9:80|html/www|默認| **3.環境搭建** ```sh yum install nginx -y egrep -v "#|^$" /etc/nginx/nginx.conf.default >/etc/nginx/nginx.conf mkdir -p /data/html/www cp /usr/share/nginx/html/* /data/html/www sed -ri '/^$|#/d' /etc/nginx/nginx.conf sed -ri '/^$|#/d' /etc/nginx/conf.d/default.conf 省略 ``` ## 二、處理方法: ### 1.完成nginx網站服務器配置 **創建測試環境** 10.0.0.8 主機上創建upload目錄,然后生成網站測試頁面文件 ```sh mkdir -p /data/html/www/upload echo "test in Ip 10.0.0.8 is upload" >/data/html/www/upload/noah.html ``` 10.0.0.7 主機上創建static目錄,然后生成網站測試頁面文件 ```sh mkdir -p /data/html/www/static echo "test in Ip 10.0.0.7 is static" >/data/html/www/upload/noah.html ``` 10.0.0.9 主機上創建默認測試頁面文件即可 ```sh echo "test in Ip 10.0.0.9 is default" >/data/html/www/noah.html ``` ### 2.利用lb01進行訪問測試 測試10.0.0.8訪問是否正常 ```sh curl -H host:www.etiantian.org 10.0.0.8/upload/noah.html web02 www.etiantian.org ``` 測試10.0.0.7訪問是否正常 ```sh curl -H host:www.etiantian.org 10.0.0.7/static/noah.html web01 www.etiantian.org ``` 測試10.0.0.9訪問是否正常 ```sh curl -H host:www.etiantian.org 10.0.0.9/noah.html web03 www.etiantian.org ``` ### 3.完成nginx反向代理服務器配置 1)配置upstream模塊信息 ```sh upstream upload { server 10.0.0.8:80; } upstream static { server 10.0.0.7:80; } upstream default { server 10.0.0.9:80; } ``` 2)配置proxy_pass模塊信息 ```sh server { listen 80; server_name www.etiantian.org; root html; index index.html index.htm; location / { proxy_pass http://default; proxy_set_header host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /upload { proxy_pass http://upload; proxy_set_header host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /static { proxy_pass http://static; proxy_set_header host $host; proxy_set_header X-Forwarded-For $remote_addr; } } ```
                  <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>

                              哎呀哎呀视频在线观看