nginx configures multiple vue projects

  • 2020-05-14 06:01:30
  • OfStack

demand

Multiple vue projects are configured under nginx

For example:

[

blog: https://www.yoursite.com/blog
test: https://www.yoursite.com/test

]

Configuration in the vue project

vue-router sets the base path

[

base: '/blog/'

]

Modified assetsPublicPath config/index js

[

assetsPublicPath: '/blog/'

]

nginx configuration


location /blog {
try_files $uri $uri/ /blog/index.html;
}


Related articles: