部署vue项目笔记
- vue项目,本地打包,npm run build
- 打包之后有dist目录
- nginx的配置指向dist根路径
- 直接访问nginx服务器就行了
server { listen XXXX; server_name XXXXXXXXX; location / { root /usr/local/vue-app/dist的根目录地址; try_files $uri $uri/ /index.html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }