<div dir="ltr"><div><div><div><div><div>Hi,<br><br>this is more disscussion for wildfly forums but anyhow....<br><br></div>&quot;default-host&quot; 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"> &lt;server name=&quot;default-server&quot; </font><font face="Courier New"><font face="Courier New"> <b>default-host=&quot;other-host&quot;</b></font>&gt;</font>
<div><font face="Courier New">                &lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot;&gt;</font></div>
<div><font face="Courier New">                    &lt;location name=&quot;/&quot; handler=&quot;welcome-content&quot;/&gt;</font></div>
<div><font face="Courier New">                    &lt;filter-ref name=&quot;server-header&quot;/&gt;</font></div>
<div><font face="Courier New">                    &lt;filter-ref name=&quot;x-powered-by-header&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;/host&gt;<br></font><font face="Courier New">                &lt;host <b>name=&quot;other-host&quot;</b> alias=&quot;some.other.host, some.alias&quot;&gt;</font><font face="Courier New"><br>                    &lt;filter-ref name=&quot;server-header&quot;/&gt;</font>
<div><font face="Courier New">                    &lt;filter-ref name=&quot;x-powered-by-header&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;/host&gt;</font><br></div></div><font face="Courier New">            &lt;/server&gt;</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 &lt;virtual-host&gt;name-of-other-host&lt;/virutal-host&gt;<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">&lt;<a href="mailto:gpn@networkart.com" target="_blank">gpn@networkart.com</a>&gt;</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">        &lt;subsystem xmlns=&quot;urn:jboss:domain:undertow:1.2&quot;&gt;</font></div>
<div><font face="Courier New">            &lt;buffer-cache name=&quot;default&quot;/&gt;</font></div>
<div><font face="Courier New">            &lt;server name=&quot;default-server&quot;&gt;</font></div>
<div><font face="Courier New">                &lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot;&gt;</font></div>
<div><font face="Courier New">                    &lt;location name=&quot;/&quot; handler=&quot;welcome-content&quot;/&gt;</font></div>
<div><font face="Courier New">                    &lt;filter-ref name=&quot;server-header&quot;/&gt;</font></div>
<div><font face="Courier New">                    &lt;filter-ref name=&quot;x-powered-by-header&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;/host&gt;</font></div>
<div><font face="Courier New">            &lt;/server&gt;</font></div>
<div><font face="Courier New">            &lt;servlet-container name=&quot;default&quot;&gt;</font></div>
<div><font face="Courier New">                &lt;jsp-config/&gt;</font></div>
<div><font face="Courier New">                &lt;websockets/&gt;</font></div>
<div><font face="Courier New">            &lt;/servlet-container&gt;</font></div>
<div><font face="Courier New">            &lt;handlers&gt;</font></div>
<div><font face="Courier New">                &lt;file name=&quot;welcome-content&quot; path=&quot;${jboss.home.dir}/welcome-content&quot;/&gt;</font></div>
<div><font face="Courier New">            &lt;/handlers&gt;</font></div>
<div><font face="Courier New">            &lt;filters&gt;</font></div>
<div><font face="Courier New">                &lt;response-header name=&quot;server-header&quot; header-name=&quot;Server&quot; header-value=&quot;WildFly/8&quot;/&gt;</font></div>
<div><font face="Courier New">                &lt;response-header name=&quot;x-powered-by-header&quot; header-name=&quot;X-Powered-By&quot; header-value=&quot;Undertow/1&quot;/&gt;</font></div>
<div><font face="Courier New">            &lt;/filters&gt;</font></div>
<div><font face="Courier New">        &lt;/subsystem&gt;</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&quot;</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>