This is related to two posts -
Hosting multiple domains with WildFly (Undertow),
WildFly -> Undertow -> maping subdomain to war file not working
The workaround with creating/editing jboss-web.xml does not seem to be working.
I tried this workaround for my scenario where two virtual hosts are served exactly with the same WAR files, with no context-root configuration.
In wildfly/standalone/configuration/standalone.xml:
<host name="domain1" alias="domain1.rootdomain.com">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
<host name="domain2" alias="domain2.rootdomain.com">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
In jboss-web.xml:
<jboss-web>
<virtual-host>domain1</virtual-host>
<virtual-host>domain2</virtual-host>
</jboss-web>
During deploy/redeploy Wildfly complains that already one virtual-host tag was processed and the deployment/redeployment fails.
Is there any other solution for this problem?