vue subdirectory configuration, load balancing nginx

1. I use is that Tencent cloud load balancing.

  Load balancing configuration: https://www.xxxx.com/vue domain name server address points: 10.10.10.10: 80 / vue

2. nginx configuration:

{Server 
        the listen        80 ; 
        LOCATION / VUE { 
        #root address of the last point is: / home / h5 / vue / static document root
/ Home / H5; index index.html index.htm; try_files $ uri $ uri / / VUE / index .html; } }

3. vue Configuration

I use the vue-cli 3, 

vue.config.js file configuration

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

Routing configuration, routers.js

fashion: ' history ' , 
base: ' / View ' ,

ok

 

Guess you like

Origin www.cnblogs.com/easonchean/p/12573698.html