title: WildFly -> Undertow -> mapping subdomain to war file not working
body: <p>WildFly 8.1.0 Final
      Windows Server 2012 R2</p>
  
  <p>I have two sub-domains pointing at this server, and I want requests to each sub-domain to trigger a different war file:-</p>
  
  <pre><code>webapp.domain1.com -&gt; WildFly Server -&gt; myapp1.war
  test.domain2.net -&gt; WildFly Server -&gt; myapp2.war
  </code></pre>
  
  <p>My standalone.xml file is currently configured as follows based on advice received on the JBoss Developer site:-</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:undertow:1.1"&gt;
    &lt;buffer-cache name="default"/&gt;
  
    &lt;server name="default-server"&gt;
      &lt;http-listener name="default" socket-binding="http"/&gt;
  
      &lt;host name="default-host" default-web-module="myapp1.war" alias="webapp.domain1.com"/&gt;
      &lt;host name="other-host" default-web-module="myapp2.war" alias="test.domain2.net"/&gt;
    &lt;/server&gt;
  
    &lt;servlet-container name="default"&gt;
      &lt;jsp-config/&gt;
    &lt;/servlet-container&gt;
  
    &lt;filters&gt;
      &lt;response-header name="server-header" header-value="WildFly/8" header-name="Server"/&gt;
      &lt;response-header name="x-powered-by-header" header-value="Undertow/1" header-name="X-Powered-By"/&gt;
    &lt;/filters&gt;
  &lt;/subsystem&gt;
  </code></pre>
  
  <p>Pointing a browser at webapp.domain1.com or test.domain2.net results in the request being sent to the WildFly server as expected, but the same war file (myapp1.war) is triggered in both cases.</p>
  
  <p>Switching the 'name' values of the &lt;host .../&gt; elements as follows results in myapp2.war being called whichever URL is used:-</p>
  
  <pre><code>    &lt;host name="other-host" default-web-module="myapp1.war" alias="webapp.domain1.com"/&gt;
      &lt;host name="default-host" default-web-module="myapp2.war" alias="test.domain2.net"/&gt;
  </code></pre>
  
  <p>It looks like Undertow is only processing details of the "default-host" entry.</p>
  
  <p>Can anyone here help with this please?</p>
  
  <p>Failing that, does anyone know if (and how) WildFly can be used with Apache Web Server?</p>