nginx部署vue前端,刷新出现404或者500错误的解决方案

在nginx配置文件的server下加上

try_files $uri $uri/ /index.html;

不加的话是404,路径错误是500,这里的路径只要照着/index.html就行,不用加上具体部署的位置

猜你喜欢

转载自www.cnblogs.com/zxcoder/p/12076181.html