前后端分离代码,前端刷新404,调整nginx.conf实现URL重写

location / {
            root   html;
            index  index.html index.htm;
        if (!-e $request_filename) {
        rewrite ^(.*)$ /index.html?s=$1 last;
        break;
        }
    }

修改成这样就可以了实现了

posted @ 2022-05-10 15:29  资深CURD小白程序猿  阅读(48)  评论(0编辑  收藏  举报