1.把vue-router的mode改为history 2.更改nginx配置,找不到页面时重定向到index.html location / { try_files $uri $uri/ /index.html; }