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
}
或者
location / {
try_files $uri $uri/ /index.html;
}
部署到gitee上需要加一个.spa文件 详见Pages 单页面应用支持
-------------------------------------------
学而不思则罔,思而不学则殆
你好,我是【咬轮猫】
-------------------------------------------