This discussion is archived
1 Reply Latest reply: Jul 18, 2008 2:32 PM by Shail Goel RSS

Change host field in header in includes

647921 Newbie
Currently Being Moderated
Hi there.

Is it possible to change host in headers for included fragment?
For example, i have some "blackbox" application on 192.168.2.144, and second instance on 192.168.2.145. Instances are independent, but both need to "listen" on host "www.someblackbox.com".
So i need something like this:

<esi:include src="http://192.168.2.144/something/special.jsp">
<esi:request_header name="host" value="www.someblackbox.com"/>
</esi:include>

<esi:include src="http://192.168.2.145/something/other.jsp">
<esi:request_header name="host" value="www.someblackbox.com"/>
</esi:include>

But this doesnt work.. Is somehow possible to force own host field?

Thanx.
  • 1. Re: Change host field in header in includes
    Shail Goel Pro
    Currently Being Moderated
    Bit late reply but if you are still looking for answer:

    The better approach would be to simply in OHS set the ServerName on both to www.someblackbox.com . That way OHS will normalize whatever host header is sent from Web Cache into ww.someblackbox.com . If you are not using OHS, that should work with any Apache based server. Don't know about IIS or SunOne.

    One other idea would be to set up two SITE definitions. With path based sites. Then the includes could specify hostname directly instead of IP address. For example:

    <esi:include src="http://www.someblackbox.com/something/special.jsp">
    </esi:include>

    <esi:include src="http://www.someblackbox.com/something/other.jsp">
    </esi:include>

    Then you don't even need the "esi:request header" stuff anymore.

    Create one SITE: www.someblackbox.com/something/special.jsp

    and another SITE: www.someblackbox.com/something/other.jsp

    And have them map to different origin servers. It would be nicer if the path prefix could be different for the two servers. For example:

    SITE one: www.someblackbox.com/content_from_server1

    SITE two: www.someblackbox.com/content_from_server2

    Thanks
    Shail