3 Replies Latest reply on Nov 1, 2013 8:12 AM by Joe Schiavone

    undertow Virtual-hosts somehost.com

    Joe Schiavone Newbie

      Im using Beta2 to setup several virtual hosts.

      I cant find any examples of how to do this using Undertow.

      I have checked the XSD's for undertow and can see that it

      appears possible.  I set the <root-context> to "/" for all of

      the somehost.war files that I deploy.   I see successful

      deploy via management console, successful assignment.

      The output shows;JBAS017534: Register web context: /

      at the end of deployment.  HOWEVER, http://somehost.com

      gets 404 error.    BTHY, I can set the handler to show the

      directory-listing=true and then see a dir listing of the

      wildfly install directory.

      Examples greatly appreciated, and good job to all developers

      of wildfly with undertow, looks very promising!

        • 1. Re: undertow Virtual-hosts somehost.com
          Tomaz Cerar Master

          To be fair i cannot understand what you want to achieve from your post.

          In any case, this is example configuration with additional "other-host" virtual host defined:


          <server name="default-server">
                      <host name="default-host" alias="localhost">
                          <location name="/" handler="welcome-content">
                    <host name="other-host" alias="www.mysite.com, some.other.domain.tld" >
                      <location name="/" handler="welcome-content">


          then in jboss-web.xml you need to do mapping to your virtual host by defining <virtual-host>other-host</virtual-host>

          if you add also <context-root>/</context-root> it will bind your war to other-host under / context.

          host can have any number of aliases under which it available.




          • 2. Re: undertow Virtual-hosts somehost.com
            Joe Schiavone Newbie

            To be fair,  the configuration in your post is exactly what I have, including the jboss-web.xml config that you

            provide.   Works Great in jboss 6...   

            • 3. Re: undertow Virtual-hosts somehost.com
              Joe Schiavone Newbie

              GOT IT!    Here is whats not clear, nor could I find any documentation on "other-host"..

              Dah,,,  <host name="other-host"    is  important not just the alias has to map to your DNS

              but the name "other-host"  HAS TO EQUAL  your virtual-host tag  in the jboss XML file..

              Works Great,, Thanx to all that respond.   

              1 of 1 people found this helpful