<div dir="ltr">Quick update<div><br></div><div>In order to see the 503 Status code specified in the  default-response-code attribute on the host-element</div><div>I had to remove the welcome-content filter by omitting the </div><div>   &lt;location name=&quot;/&quot; handler=&quot;welcome-content&quot;/&gt;<br></div><div>element.</div><div><br></div><div>However even with that config I see the following sequence from a repeated curl sequence:</div><div>watch -n 2 curl -I <a href="http://localhost:8080/auth/">http://localhost:8080/auth/</a><br></div><div><br></div><div><div>Server not started                                   : Connection Refused...</div><div>Server Started...                                     : HTTP/1.1 404 Not Found</div><div>Begin Web App Deployment (Keycloak): HTTP/1.1 503 Service Unvailable</div><div>Web App Deployed                                : HTTP/1.1 200 OK</div></div><div> </div><div>My example configuration</div><div><div>&lt;subsystem xmlns=&quot;urn:jboss:domain:undertow:3.0&quot;&gt;</div><div>    &lt;buffer-cache name=&quot;default&quot;/&gt;</div><div>    &lt;server name=&quot;default-server&quot;&gt;</div><div>        &lt;ajp-listener name=&quot;ajp&quot; socket-binding=&quot;ajp&quot;/&gt;</div><div>        &lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot; redirect-socket=&quot;https&quot;/&gt;</div><div><br></div><div>        &lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot; default-response-code=&quot;503&quot;&gt;</div><div>        &lt;/host&gt;</div><div>    &lt;/server&gt;</div><div>    &lt;servlet-container name=&quot;default&quot;&gt;</div><div>        &lt;jsp-config/&gt;</div><div>        &lt;websockets/&gt;</div><div>    &lt;/servlet-container&gt;</div><div>    &lt;handlers&gt;</div><div>    &lt;/handlers&gt;</div><div>    &lt;filters&gt;</div><div>    &lt;/filters&gt;</div><div>&lt;/subsystem&gt;</div></div><div><br></div><div>Cheers,</div><div>Thomas</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-30 22:44 GMT+01:00 Thomas Darimont <span dir="ltr">&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Stuart,<div><br></div><div>thanks for the reply - I got a similar tip on the keycloak-user list however if I configure the default-response-code=503</div><div>on the (single) host element of the undertow subsystem in Wildfly (10.1.0) and restart the server then I get a </div><div>404 but never a 503 when I access paths of an web app (keycloak) that is not fully initialized yet.</div><div><br></div><div>Seems that I&#39;m seeing the same behaviour as those folks:</div><div><a href="https://developer.jboss.org/thread/257526" target="_blank">https://developer.jboss.org/<wbr>thread/257526</a><br></div><div><br></div><div>Is there anything else that one needs to configure to make this work?</div><div><br></div><div>In the meantime I played a bit with alternative approaches e.g.: <a href="https://github.com/thomasdarimont/undertow-extensions" target="_blank">https://github.com/<wbr>thomasdarimont/undertow-<wbr>extensions</a></div><div><br></div><div>Cheers,</div><div>Thomas</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-01-30 22:09 GMT+01:00 Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can add the default-response-code attribute in the host element of<br>
the undertow subsystem to make it return 503 by default.<br>
<br>
Stuart<br>
<div><div class="m_3254367547602385131h5"><br>
On Mon, Jan 30, 2017 at 9:34 PM, Thomas Darimont<br>
&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.co<wbr>m</a>&gt; wrote:<br>
&gt; Hello group,<br>
&gt;<br>
&gt; (coss-post from keycloak-user Mailing List)<br>
&gt;<br>
&gt; the undertow servlet-container is started pretty early during the startup of<br>
&gt; the<br>
&gt; wildfly application server. However the initialization of the keycloak<br>
&gt; server<br>
&gt; application might take a while to complete. Within this period requests that<br>
&gt; are<br>
&gt; sent to the keycloak endpoints result in responses with HTTP Status Code<br>
&gt; 404.<br>
&gt;<br>
&gt; Is it possible to configure undertow to return a HTTP Status Code 503<br>
&gt; (Service Unvailable)<br>
&gt; until the keycloak application startup has completed?<br>
&gt;<br>
&gt; This would ease configuring load-balancers and to avoid showing a file not<br>
&gt; found<br>
&gt; to users during server restarts.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Thomas<br>
&gt;<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>