1

I'm trying to deploy an angular app war file to jboss 7. But, I'm facing a problem; 404 page not found in production build when refresh a page. I know that all Angular routes should be served via the index.html file So I must do an URL rewrite. I tried it in tomcat and it worked using

RewriteCond %{REQUEST_PATH} !-f
RewriteRule ^/dashboard/(.*) /dashboard/index.html

But I doesn't know how to do the same thing with jboss 7.

Dababi
  • 185
  • 2
  • 17

1 Answers1

0

By the help of Panagiotis Chavariotis comment (using this post), I resolved the problem by adding this configuration file WEB-INF/undertow-handlers.conf:

path-prefix('/assets') -> done;
regex('(.*).js') -> done;
regex('(.*).ttf') -> done;
regex('(.*).woff') -> done;
regex('(.*).woff2') -> done;
regex('(.*).jpg') -> done;
regex('(.*).png') -> done;
regex('(.*).css') -> done;
regex('(.*).html') -> done;
path-prefix('/') -> rewrite('/');
Dababi
  • 185
  • 2
  • 17