Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9496

WildFly 10.1 Final: Virtual Hosting

    Details

    • Steps to Reproduce:
      Hide

      Setup multiple hosts in the undertow subsystem.

      Try to access them from a public domain.

      Show
      Setup multiple hosts in the undertow subsystem. Try to access them from a public domain.
    • Affects:
      Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration, User Experience

      Description

      My configuration:

      ========= standalone-full.xml ===============

      <subsystem xmlns="urn:jboss:domain:undertow:3.1">
      <buffer-cache name="default"/>
      <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="default-host" alias="localhost">
      <location name="/" handler="welcome-content"/>
      <filter-ref name="server-header"/>
      <filter-ref name="x-powered-by-header"/>
      </host>
      <host name="host1" alias="domain1.com,www.domain1.com" default-web-module="domain1-war.war"/>
      <host name="host2" alias="domain2.com,www.domain2.com" default-web-module="domain2-war.war"/>
      </server>
      <servlet-container name="default">
      <jsp-config/>
      <websockets/>
      </servlet-container>
      <handlers>
      <file name="welcome-content" path="${jboss.home.dir}/www/welcome-content"/>
      </handlers>
      <filters>
      <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
      <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
      </filters>

      </subsystem>

      ============ /etc/hosts ============

      127.0.0.1 localhost host1 host2

      =========== domain1-war/WEB-INF/jboss-web.xml =========

      <jboss-web>

      <virtual-host>host1</virtual-host>

      <context-root>/</context-root>

      </jboss-web>

      =========== domain2-war/WEB-INF/jboss-web.xml =========

      <jboss-web>

      <virtual-host>host2</virtual-host>

      <context-root>/</context-root>

      </jboss-web>

      [EDIT] ============================================

      Wildfly is launched as per: [opt/wildfly/bin] ./standalone.sh -b=0.0.0.0 -c=standalone-full.xml

      Thus socket bindings should not be an issue.

      Notes:

      1. Server starts and all deploys and works as expected when access as host1:8080, host2:8080, localhost:8080

      Thus my webapps along with the wildfly default ROOT.war (welcome pages) work as expected.

      2. Router port 80 is forwarded to 8080

      3. When using the server aliases as defined in standalone-full.xml, in my case domain1.com or domain2.com the server times out and I get nothing.

      4. I have intercepted the request headers for domain1.com and domain2.com and they are correct.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                icjohnsoia I J
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: