1、nginx 配置
location /three-tixing/{ alias /usr/local/website/demo/three-tixing/; index index.html; try_files $uri $uri/ /three-tixing/index.html; }
1.1 location
网页输入的端口后的路径
1.2 alias
网站在服务器的路径
2.vue项目配置
2.1 vue.config.js
module.exports = { publicPath: process.env.NODE_ENV === 'production' ? '/three-tixing/' : '/' }
2.2 VueRouter