trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Payne <jp557...@gmail.com>
Subject Re: How to set the Host header of the request to the origin server in hierachical caching
Date Tue, 08 Mar 2016 21:46:51 GMT
In this pristine configuration, isnt the HOST header seen at the parent
layer still not considered by remap due to the fact the child=>parent GET
is of the absolute URL ?
So at the parent layer you would still need a remap.config entry to match
on http://origin.example.com

In other word, user request at the child looks like this

GET  /foo.bar HTTP/1.1
HOST: example.com

The request is translated by the child upon sending to the parent. This
translation is done regardless of pristine or not. So
even if you did change the HOST header, the host in the GET url takes
precedence. At least with respect to remap and given my testing.

GET http://origin.example.com/foo.bar HTTP/1.1
HOST:example.com


The parent remap would then have to match on:

map http://origin.example.com/ http://origin.example.com/

Last time I checked this is how it worked. I know there was talks of having
a parent.config option which forced the child to send a relative URL
request. Instead of the full URL GET currently sent to the parent.




On Tue, Mar 8, 2016 at 2:08 PM, Miles Libbey <mlibbey@apache.org> wrote:

> I think you'd set
> proxy.config.url_remap.pristine_host_hdr (
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-url-remap-pristine-host-hdr
> )
> to 1 (either for that remap rule using the conf_remap plugin (
> https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/conf_remap.en.html)
> or globally).
>
> Then you'd have
> child remap:
>  map http://example.com http://origin.example.com (perhaps
> with @plugin=conf_remap.so
> @pparam=proxy.config.url_remap.pristine_host_hdr=1)
> child parent.config
> dest_domain=example.com method=get parent="parent1.example.com:80
> and parent remap
> map http://example.com http://origin.example.com
>
>
> miles
>
>
>
> On Tuesday, March 8, 2016 4:04 AM, Hiroaki Nakamura <hnakamur@gmail.com>
> wrote:
>
>
> Hi all,
>
> I tried the example using the Hierarchical Caching
>
> https://docs.trafficserver.apache.org/en/latest/admin-guide/configuration/hierachical-caching.en.html#example
>
> I found the Host header of the request to the origin server become
> origin.example.com.
> I would like to this to be example.com.
> How can I set the Host header value of the request to the origin
> server to be the same as the request to the
> child cache in hierarchical cashing settings?
>
> Thanks,
> Hiroaki
>
>
>

Mime
View raw message