使用nginx部署前端项目出现404问题 解决办法 在 location / 中加入try_files $uri $uri/ /index.html;配置 location / { root /root/xxx; index index.html; try_files $uri $uri/ /index.html; } 重启nginx