1 Reply Latest reply on Nov 30, 2015 10:06 AM by moxito

    Maintenance page is not being shown via 404-handler .

    moxito

      Hello everyone.

      I need your help. I use 404-handler on Wildfly-9.0.1.Final to redirect every request to my custom maintenance page if response status is 404 "Not Found" . Everything works if the context where my war is deployed is not root "/" . If it is deployed on context for example "/myApp" it works but if change root context to "/" in jboss-web.xml does not works. This is my standalone.xml configuration :

       

      <subsystem xmlns="urn:jboss:domain:undertow:2.0">

                  <buffer-cache name="default"/>

                  <server name="default-server">

                      <http-listener name="default" socket-binding="http" redirect-socket="https"/>

                      <https-listener name="https-default" socket-binding="https" security-realm="SSLRealm"/>

                      <host name="default-host" alias="localhost">

                          <location name="/" handler="welcome-content"/>

                          <filter-ref name="server-header"/>

                          <filter-ref name="x-powered-by-header"/>

                          <filter-ref name="404-handler" predicate="true"/>

                      </host>

                  </server>

                  <servlet-container name="default">

                      <jsp-config/>

                      <websockets/>

                  </servlet-container>

                  <handlers>

                      <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>

                  </handlers>

                  <filters>

                      <response-header name="server-header" header-name="Server" header-value="WildFly/9"/>

                      <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>

                      <error-page name="404-handler" code="404" path="${jboss.home.dir}/welcome-content/maintenance/index.html"/>

                  </filters>

              </subsystem>

       

      What I have to do or change to solve this problem ?

       

      Thank you