近期有一个项目,上线部署后,发现页面刷新后报404错误,经查原来是因为路由选择的history模式,需要在nginx配置一下。
location / {
try_files $uri $uri/ /index.html;
}
近期有一个项目,上线部署后,发现页面刷新后报404错误,经查原来是因为路由选择的history模式,需要在nginx配置一下。
location / {
try_files $uri $uri/ /index.html;
}