gpt4 book ai didi

angularjs - nginx错误页面在使用路由的 Angular 应用程序中不起作用

转载 作者:行者123 更新时间:2023-12-03 07:44:18 25 4
gpt4 key购买 nike

我有一个使用路由的 Angular 应用程序,它在routes.js 文件中包含.otherwise(){},现在我需要使用nginx制作自定义错误页面,如何停止.otherwise(){}并使用在nginx 默认文件上定义的错误页面,任何人请帮我从5小时开始。或将我指向任何说明和解决此问题的链接。

最佳答案

路由中的“其他”正在寻找客户端路由。否则,您可以使用自动重定向到服务器路由的 Controller 将其定向到客户端的单独路由。

 .otherwise('/ControllerThatSendsToServer');

然后在ControllerThatSendsToServer中执行一个window.location ='server error page';

关于angularjs - nginx错误页面在使用路由的 Angular 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48887400/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com