jdrew
jdrew

Reputation: 15

Simple Virtual Host in Wildfly does not work

I am running Wildfly v32 and I am trying to map multiple localhost domains to an app. I have put a simple "hello world" WAR app in standalone/deployments and I can access it using localhost:8080/hello.war

In the standalone.xml file, I have only added the following:

- in <host> I added the 2 lines for sites localhost/url1 & localhost/url2 respectively, after the existing location for root:

<host name="default-host" alias="localhost">
    <location name="/" handler="welcome-content"/>
    <location name="/url1" handler="site1handler"/>
    <location name="/url2" handler="welcome-content"/>
    <http-invoker http-authentication-factory="application-http-authentication"/>
</host>

- in <handlers> I added the new handler, after the existing one:

<handlers>
    <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
    <file name="site1handler" path="${jboss.home.dir}/standalone/deployments/hello.war" directory-listing="false"/>
</handlers>

As a result:

  1. The virtual host for "/url2" works, so when I visit localhost:8080/url2 I see the standard welcome message
  2. As I already mentioned, when I visit localhost:8080 I see the "hello world" WAR site
  3. But when I visit localhost:8080/url1 I get a 404 error and a download window for a file "url1" isntead of seeing the "hello world" WAR app.

What am I doing wrong?

Upvotes: 0

Views: 43

Answers (0)

Related Questions