Quick update
In order to see the 503 Status code specified in the default-response-code attribute on the host-element
I had to remove the welcome-content filter by omitting the
<location name="/" handler="welcome-content"/>
element.
However even with that config I see the following sequence from a repeated curl sequence:
Server not started : Connection Refused...
Server Started... : HTTP/1.1 404 Not Found
Begin Web App Deployment (Keycloak): HTTP/1.1 503 Service Unvailable
Web App Deployed : HTTP/1.1 200 OK
My example configuration
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost" default-response-code="503">
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
</handlers>
<filters>
</filters>
</subsystem>
Cheers,
Thomas