解决方法:

在server配置文件内加上

location / {
   try_files $uri $uri/ @router;
   index index.html;
}

location @router {
    rewrite ^.*$ /index.html last;
}

就可以解决强制刷新页面404的情况了,防止以后遇见这种情况遗忘,特在此记录

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐