0
点赞
收藏
分享

微信扫一扫

Vue项目部署Nginx后,刷新页面出现404问题

在Nginx配置文件nginx.conf中加入如下配置。(index.html根据实际页面配置)

增加:try_files $uri $uri/ /index.html; #解决页面刷新404问题

server {
listen 8080;
server_name localhost;

location / {
root D:\vipsoft\dist;
index index.html index.htm;
try_files $uri $uri/ /index.html; #解决页面刷新404问题
}


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

 



举报

相关推荐

0 条评论