I have an angular app that uses routes, where it has .otherwise(){}
in routes.js file and now I need to make custom error pages using nginx, how to stop the .otherwise(){}
and use the error pages defined on nginx default file, Anyone Please help I'm working on it from 5hrs. Or point me to any link that explains and solves this problem.
Asked
Active
Viewed 156 times
2

mast3rd3mon
- 8,229
- 2
- 22
- 46

Avinash Dv
- 109
- 1
- 2
- 10
-
are you using angularjs or angular? – mast3rd3mon Feb 20 '18 at 14:24
-
I'm using angular js – Avinash Dv Feb 20 '18 at 14:26
-
when using angularjs, please tag the correct angular tag – mast3rd3mon Feb 20 '18 at 14:27
-
@mast3rd3mon apologies for that. Any solution for the above – Avinash Dv Feb 20 '18 at 14:30
1 Answers
0
"Otherwise" in the routing is looking for a client side route. You can probably direct otherwise to a separate route on the client side with a controller that automatically redirects to a server route.
.otherwise('/ControllerThatSendsToServer');
Then in the ControllerThatSendsToServer just do a window.location = 'server error page';

Stradosphere
- 1,285
- 3
- 14
- 40