<div dir="ltr"><div><div><div><div><div>Hi,<br><br>this is more disscussion for wildfly forums but anyhow....<br><br></div>"default-host" is configured as default and as such all non otherwise matching host will end up being served by default host.<br><br></div>you could add another host and which will be used only when host matches the one you want or add extra host and make it default<br><br></div><div>an example what you could do:<br></div><br><font face="Courier New"> <server name="default-server" </font><font face="Courier New"><font face="Courier New"> <b>default-host="other-host"</b></font>></font>
<div><font face="Courier New"> <http-listener name="default" socket-binding="http"/></font></div>
<div><font face="Courier New"> <host name="default-host" alias="localhost"></font></div>
<div><font face="Courier New"> <location name="/" handler="welcome-content"/></font></div>
<div><font face="Courier New"> <filter-ref name="server-header"/></font></div>
<div><font face="Courier New"> <filter-ref name="x-powered-by-header"/></font></div>
<div><font face="Courier New"> </host><br></font><font face="Courier New"> <host <b>name="other-host"</b> alias="some.other.host, some.alias"></font><font face="Courier New"><br> <filter-ref name="server-header"/></font>
<div><font face="Courier New"> <filter-ref name="x-powered-by-header"/></font></div>
<div><font face="Courier New"> </host></font><br></div></div><font face="Courier New"> </server></font><br></div><br>Just keep in mind that if using non-default host, you need to tell your application to use it by adding jboss-web.xml with <virtual-host>name-of-other-host</virutal-host><br><br>--<br></div>tomaz<br><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 17, 2015 at 10:05 AM, Guruprasad Nagaraj <span dir="ltr"><<a href="mailto:gpn@networkart.com" target="_blank">gpn@networkart.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hi,
<div>I am using Wildfly 8.2 Final.</div>
<div>I am using the default Undertow subsystem configuration -</div>
<div><br>
</div>
<div>
<div><font face="Courier New"> <subsystem xmlns="urn:jboss:domain:undertow:1.2"></font></div>
<div><font face="Courier New"> <buffer-cache name="default"/></font></div>
<div><font face="Courier New"> <server name="default-server"></font></div>
<div><font face="Courier New"> <http-listener name="default" socket-binding="http"/></font></div>
<div><font face="Courier New"> <host name="default-host" alias="localhost"></font></div>
<div><font face="Courier New"> <location name="/" handler="welcome-content"/></font></div>
<div><font face="Courier New"> <filter-ref name="server-header"/></font></div>
<div><font face="Courier New"> <filter-ref name="x-powered-by-header"/></font></div>
<div><font face="Courier New"> </host></font></div>
<div><font face="Courier New"> </server></font></div>
<div><font face="Courier New"> <servlet-container name="default"></font></div>
<div><font face="Courier New"> <jsp-config/></font></div>
<div><font face="Courier New"> <websockets/></font></div>
<div><font face="Courier New"> </servlet-container></font></div>
<div><font face="Courier New"> <handlers></font></div>
<div><font face="Courier New"> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/></font></div>
<div><font face="Courier New"> </handlers></font></div>
<div><font face="Courier New"> <filters></font></div>
<div><font face="Courier New"> <response-header name="server-header" header-name="Server" header-value="WildFly/8"/></font></div>
<div><font face="Courier New"> <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/></font></div>
<div><font face="Courier New"> </filters></font></div>
<div><font face="Courier New"> </subsystem></font></div>
</div>
<div><br>
</div>
<div>As you see I do not have any aliases apart from the localhost.</div>
<div><br>
</div>
<div>I have a local DNS entry which points <a href="http://acme.example.com" target="_blank">acme.example.com</a> to the IP Address of the Wildfly Server/Host.</div>
<div><br>
</div>
<div>When I try to fetch a page <a href="http://acme.example.com:8080/SVWeb/index.html" target="_blank">http://acme.example.com:8080/SVWeb/index.html</a>, I do get the page back. While undertow does not know about this host, how is it that I get the content
back?</div>
<div>The Host header in the HTTP request is indeed -</div>
<div>Host: “<a href="http://acme.example.com" target="_blank">acme.example.com</a>:8080"</div>
<div><br>
</div>
<div>Should I use any filters or access control to let Undertow know not serve unknown hosts?</div>
<div><br>
</div>
<div>
<div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="text-align:-webkit-auto;text-indent:0px;word-wrap:break-word">
<div style="text-align:-webkit-auto;text-indent:0px;word-wrap:break-word">
<div style="margin:0px;font-size:12px">
<div>
<div style="word-wrap:break-word">
<div style="word-wrap:break-word">
<div style="word-wrap:break-word">
<div style="margin:0px;font-size:12px">Thanks and Best Regards,</div>
<div style="margin:0px;font-size:12px">GPN</div>
<div style="margin:0px;font-size:12px"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br></blockquote></div><br></div>