1

I have two domains pointing to two deployments in the same Wildfly instance.
My goal is, typing one or another in the browser, the server redirects to the specific .war file.

Currently, my configuration at standalone.xml is:

<server name="default-server">
    <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
    <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
    <host name="app1" alias="app1.mydomain.com" default-web-module="app1.war">
       <filter-ref name="server-header"/>
       <filter-ref name="x-powered-by-header"/>
    </host>
    <host name="app2" alias="app2.mydomain.com" default-web-module="app2.war">
       <filter-ref name="server-header"/>
       <filter-ref name="x-powered-by-header"/>
    </host>
    <host name="default-host" alias="localhost">
       <location name="/" handler="welcome-content"/>
       <filter-ref name="server-header"/>
       <filter-ref name="x-powered-by-header"/>
    </host>
    [...]
</server>

When I try to access, for example, app1.mydomain.com the browser correctly redirects to the desired artifact, displaying the application, but missing some images and resources, due the following:

When I was using only one domain (with no virtual server), the root url of the app1 was http://app1.mydomain.com/app1 and now is http://app1.mydomain.com. So, I want the virtual server to add the context /app1 again to the application.
Is this possible?

elias
  • 15,010
  • 4
  • 40
  • 65

0 Answers0