2

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.

mast3rd3mon
  • 8,229
  • 2
  • 22
  • 46
Avinash Dv
  • 109
  • 1
  • 2
  • 10

1 Answers1

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