JBossWeb 7.2.0.Final --- <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"/> <connector name="http1" protocol="HTTP/1.1" scheme="http" socket-binding="http1" redirect-port="8443"> <virtual-server name="vs1"/> </connector> <virtual-server name="default-host" enable-welcome-root="false"> <alias name="localhost"/> </virtual-server> <virtual-server name="vs1"> <alias name="localhost"/> </virtual-server> </subsystem> ... <socket-binding name="http" port="8080"/> <socket-binding name="http1" port="8180"/> Goto "localhost:8180" --> results in 403.
I have tried it, and I am getting the same resutls as ajustin, but only if I have enable-welcome-root="true" otherwise I am getting for both cases 404 (In my case I used JBoss Web 7.2.1.Final). Note; If you set the enable-welcome-root="true" via CLI and use only server reload, you start getting 200 responses with web content till you don't restart the EAP server, then it behaves the way as described by ajustin in Comment 0
-Dorg.apache.catalina.connector.USE_IP_PORT_FOR_ALIAS=true and use Alias like the following: <virtual-server name="vs1"> <alias name="localhost:8080"/> </virtual-server> <virtual-server name="vs2"> <alias name="localhost:8180"/> </virtual-server>
Note the connector have to be associated to one virtual-host but the alias should cover all the hostname/port you want to limit to a connector.
For the latests bits EAP 6.3.0.ER10 the behaviour is the same as described by Radim in Comment 1.
See comments from Jean-Frédéric. Even though a vhost can be "associated" with a connector, all the vhosts mapping is still done in a single place, so the name and aliases must be unique in the web container. Besides, it would also cause issues with internal mapping (ex: rewrite).
I have verified that proposed solution by Jean-Frederic works. I am closing this bug, if you have any objections be free and reopen it. My configuration looks like this: <system-properties> <property name="org.apache.catalina.connector.USE_IP_PORT_FOR_ALIAS" value="true"/> </system-properties> ... <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"/> <connector name="http1" protocol="HTTP/1.1" scheme="http" socket-binding="http1" redirect-port="8443"> <virtual-server name="vs2"/> </connector> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost:8080"/> </virtual-server> <virtual-server name="vs2" enable-welcome-root="true"> <alias name="localhost:8180"/> </virtual-server> </subsystem> ... <socket-binding name="http" port="8080"/> <socket-binding name="http1" port="8180"/>