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

                ![](https://cdn.zimug.com/wx-zimug.png) ## 一、修改打包配置 我希望: * 在生產環境上,訪問該前端應用就http://ip:port/dongbb * 在測試環境上,訪問該前端應用就http://ip:port vue.config.js ![](https://img.kancloud.cn/a6/ca/a6cac0df1b0f1f07463536a85813797d_1189x257.png) 所以做這個配置,這個配置只做一次就可以了。 后端接口訪問地址,api-axios的請求實例,請求地址配置(改成后端服務的實際地址).在src/api/index.js中 ~~~ export const jwtServerInstance = new HttpRequest("http://123.56.169.21:8201") ~~~ ## 二、打包 ~~~ npm run build ~~~ 打包結果多出一個dist文件夾,將該文件夾內的文件全部上傳服務器,我選擇的存放目錄是:/usr/local/nginx/html/dongbb ![](https://img.kancloud.cn/2b/bb/2bbb65068aa955a55c0e008df60c9483_365x546.png) ## 三、配置nginx服務 vim /usr/local/nginx/conf/nginx.conf,下文紅色邊框是我新增的部分。 ![](https://img.kancloud.cn/c3/6b/c36b10d1b61a6e9ab514d25bb238748a_689x332.png) * server.root 表示以/usr/local/nginx/html作為項目的根路徑 * location表示一個項目,location:/dongbb表示項目根目錄下面的項目路徑/dongbb * index.html表示項目入口 * `try_files $uri $uri/ /dongbb/index.html; `是一種相對特殊的用法,當你選擇了vue路由的history模式,這個位置就需要這么配置。vue官方給出的方案。 配置修改完成后,nginx重新加載配置文件,生效。 ``` /usr/local/nginx/sbin/nginx -s reload ```
                  <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>

                              哎呀哎呀视频在线观看