Wildfly - Virtual hosts

127 views
Skip to first unread message

eng.dan...@gmail.com

unread,
Sep 16, 2021, 6:09:58 AM9/16/21
to WildFly
Hello,

We are using wildfly 24.0.1 and trying to configure multiple virtual hosts

We have 2 webapps ( webapp1.war and webapp2.war ) deployed.

For instance without virtual hosting we access the webapps with


After adding virtualhosts (bellow standalone configuration)

<host name="default-host" alias="localhost">
<filter-ref name="404-handler"/>
<filter-ref name="gzipFilter" predicate="exists('%{o,Content-Type}') and regex(pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true)"/>
<filter-ref name="Vary-header"/>
<filter-ref name="X-Robots-Tag"/>
<filter-ref name="xFrameOptions"/>
<filter-ref name="Content-Security-Policy"/>
<filter-ref name="transport-security"/>
<http-invoker security-realm="ApplicationRealm"/>
</host>

<host name="webapp1.mydomain.com" alias="webapp1.mydomain.com " default-web-module="webapp1.war">
<filter-ref name="404-handler"/>
<filter-ref name="gzipFilter" predicate="exists('%{o,Content-Type}') and regex(pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true)"/>
<filter-ref name="Vary-header"/>
<filter-ref name="X-Robots-Tag"/>
<filter-ref name="xFrameOptions"/>
<filter-ref name="Content-Security-Policy"/>
<filter-ref name="transport-security"/>
<http-invoker security-realm="ApplicationRealm"/>
</host>

 <host name="webapp2.mydomain.com" alias="webapp2.mydomain.com " default-web-module="webapp2.war">
<filter-ref name="404-handler"/>
<filter-ref name="gzipFilter" predicate="exists('%{o,Content-Type}') and regex(pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true)"/>
<filter-ref name="Vary-header"/>
<filter-ref name="X-Robots-Tag"/>
<filter-ref name="xFrameOptions"/>
<filter-ref name="Content-Security-Policy"/>
<filter-ref name="transport-security"/>
<http-invoker security-realm="ApplicationRealm"/>
</host>

the access via virtualhosts ( http://webapp1.mydomain.com and  http://webapp2.mydomain.com) is working as expected however when accessing via http://locahost:8080/webapp1 its return http error 404.

I'm missing something?

Thanks for your help

Daniel
Reply all
Reply to author
Forward
0 new messages