问题描述
https://XXX/login.html 可以访问
https://XXX 不会自动跳转到index.html,code404
解决过程
location / {
index index.html index.htm;
expires 1d;
try_files $uri $uri/ /index.html;
}
报错:Uncaught SyntaxError: Unexpected token <
解决办法
rewrite ^.+(?<!js|css|png|map|woff|woff2|png|svg)$ /index.html break;
将请求资源全部添加
参考
https://segmentfault.com/a/1190000022554576