blazor发布之后 刷新404的解决方法

其实所有单页面应用都一样

只需要在nginx里面配置

        location / {
            root   html;
            index  index.html index.htm;
            rewrite ^/.*/$ / last; # Redirect everything to / (ex index.html) and let the JS router take care of the rest
            rewrite ^([^.]*[^/])$ $1/ permanent; # Force trailing slash
        }

部署到gitee上需要加一个.spa文件 详见Pages 单页面应用支持

-------------------------------------------

学而不思则罔,思而不学则殆

你好,我是【咬轮猫】

-------------------------------------------

原文地址:https://www.cnblogs.com/Hero-/p/14263941.html