zoukankan      html  css  js  c++  java
  • vue 子目录配置,负载均衡 nginx

    1. 我使用的是,腾讯云做负载均衡。

      负载均衡配置: https://www.xxxx.com/vue   域名指向的服务器地址:10.10.10.10:80/vue

    2. nginx 配置:

    server {
            listen       80;
            location /vue{
            #root 最后指向的地址是: /home/h5/vue/静态文件 root
    /home/h5; index index.html index.htm; try_files $uri $uri/ /vue/index.html; } }

    3. vue 配置

    我是用的是 vue-cli 3 , 

    vue.config.js 文件配置

    module.exports = {
           publicPath: '/vue/'  
    }

    路由配置,routers.js

    mode: 'history',
    base: '/vue',

    ok

  • 相关阅读:
    Vue基础
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
  • 原文地址:https://www.cnblogs.com/easonchean/p/12573698.html
Copyright © 2011-2022 走看看