<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之旅 廣告
                ## 一、history路由模式的特殊配置 hash 模式通用性好,而且不依賴服務器的配置,省心省力,但是缺點是不夠優雅。相比于 hash 模式來說,history 模式則更加美觀; 對于hash路由模式,nginx無需特殊配置,對于history路由模式,則需要增加額外配置項才可以; history 模式會有一個問題,就是當頁面刷新時,如果沒有合適的配置,會出現頁面 404 的錯誤。因此需要額外的服務器配置,對于找不到的 url,將首頁 html 返回; ``` location / { try_files $uri $uri/ /index.html; } ``` ## 二、設置前端服務器的IP地址 如果使用了反向代理,后端就無法獲取到真實客戶端IP,必須增加頭,才可以; ``` proxy_set_header X-Real-IP $remote_addr; ``` ## 三、history模式地址重定向為hash路由模式 ``` location / { rewrite ^/home/register(.*) /home#/register permanent; } ``` ![](https://img.kancloud.cn/6c/27/6c27a6806554b80cfdbffb45053073a7_732x165.png) ## 四、一個服務器部署兩個應用 ### **根應用需重寫地址** ``` location / { root html/mobile; index index.html index.htm; try_files $uri $uri/ /index.html; index index.html index.htm; rewrite ^/home/register(.*) /home#/register permanent; rewrite ^/login(.*) /#/login permanent; } location /admin/ { alias /usr/lib/app/nginx/html/admin/; try_files $uri $uri/ /index.html; index index.html index.htm; } ``` ### **非根應用需重寫地址:** ``` location / { root html/www; index index.html index.htm; try_files $uri $uri/ /index.html; } location /cardapply { alias /usr/lib/app/nginx/html/cardapply/; try_files $uri $uri/ /index.html; index index.html index.htm; rewrite ^/cardapply/applycard(.*) /cardapply/#/applycard permanent; } ``` ## 五、根據瀏覽器類型選擇手機版或PC版 ``` set $is_mobile false; if ($http_user_agent ~* (harmonyos|android|ip(ad|hone|od)|kindle|blackberry|windows\s(ce|phone))) { set $is_mobile true; } location / { if ( $is_mobile = true ) { root html/wwwmobile; } if ($is_mobile = false ) { root html/www; } index index.html index.htm; try_files $uri $uri/ /index.html; } ```
                  <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>

                              哎呀哎呀视频在线观看