Re: [SQU] redirect_rewrites_host_header

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 21 Aug 2000 21:05:34 +0200

Toby Dickenson wrote:
>
> I have recently upgraded my http accelerator from 2.2.stable4 to
> 2.3.stable4, and discovered a change in behaviour....
>
> In 2.2 is was possible for the accelerator to copy the client-supplied
> Host header into the request it made to the real server. The Host as
> seen by the real server contained the address of the accelerator.
>
> As far as I can see, 2.3 always rewrites the Host header unless a
> redirector is used. Is there any other way to get 2.3 to leave the
> Host header intact, or will I have to use a dummy redirector?

No, simply because in 99.9% of all setups where the Host header are used
like this it is not done correctly. Simply using httpd_accel_host and
turning off Host header rewrites does not work as Squid then will mix
all the domains together in the cache. For a multi-domain acceleration
to work properly Squid must internally use unique URL's for the
different domains, and the way to get that is by enabling
httpd_accel_uses_host_header...

About the only setup where you can get by with not having Squid rewrite
the Host headers, not use a redirector, and still use httpd_accel_host
to send all the requests to the same backend server is when the Host
header are only used for statistics, not content selection.

What you can do (and probably should) is to make sure that Squid
requests the accelerated URL's using the same domainname as requested,
and map these to the backend servers using /etc/hosts or a private DNS
server.

Your other option is to use a redirector to rewrite the URL's to backend
domains. Note however that the above requirement of uniqueness still
applies.

If you only have a single backend server then there are a new
"httpd_accel_single_host" option to simplify it a bit in the upcoming
2.4 release (I don't think it is in the 2.3 release). With this option
you can enable httpd_accel_uses_host_header, and still have all requests
sent to the server defined in httpd_accel_host.

--
Henrik Nordstrom
Squid hacker
--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Mon Aug 21 2000 - 13:16:46 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:54:57 MST