美文网首页
解决nginx 部署vue项目刷新页面404问题

解决nginx 部署vue项目刷新页面404问题

作者: 隔壁老杨106 | 来源:发表于2021-07-31 16:57 被阅读0次

在配置文件中添加 try_files $uri $uri/ /index.html;

 server {
    listen 80;
    server_name www.tianxiashiguan.com tianxiashiguan.com;
    access_log /data/wwwlogs/access_nginx.log combined;
    root /data/wwwroot/dist/;
    index index.html index.htm index.jsp;
    try_files $uri $uri/ /index.html;//此处解决刷新页面出现404的问题
   
  }

相关文章

网友评论

      本文标题:解决nginx 部署vue项目刷新页面404问题

      本文链接:https://www.haomeiwen.com/subject/enkkvltx.html