Re: http_accel and forwarding loops

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 10 Jan 1999 07:30:54 +0100

Harris, John wrote:

> This means that squid looks at http_accel_port, but NOT at httpd_accel_host,
> at least in our circumstances.

Not true. Squid looks at httpd_accel_host (or Host: header if
httpd_accel_uses_host_header is on) for accelerated requests, but not
for proxied ones. If you are running a combined proxy/accelerator then
special care must be taken to handle proxied requests for the
accelerated domain(s) correctly.

This is one of the reasons why I recommend configuring a accelerator
with a local host table instead of relying on httpd_accel_host to
rewrite the host name. Other reasons are that is is a lot easier to
scale a host table when the number of hosts / domains grows, and that it
keeps a clear relationship between the official domain names and the
cache contents.

My recommended setup for a accelerator:

* A local host table listing the accelerated servers/domains, with their
backend IP addresses.
* The OS configured to prefer local host table over DNS, so that the
local host table overrides any DNS entries for the same hosts.
* Each backend server configured with the official domain names as
server name, but running on another IP address (all web servers I know
of support this).
* squid.conf:
    httpd_accel_host your.main.server
    httpd_accel_port 80
    httpd_accel_uses_host_header on
    acl dst backends backendservers...
    http_access allow backends

It is possible to use special DNS names instead of a local host table,
but then a redirector is needed.

A redirector is also needed if you need to provide multiple official IP
addresses (httpd_accel_host virtual) for clients not sending Host:
headers.

---
Henrik Nordstrom
Spare time Squid hacker
Received on Sat Jan 09 1999 - 23:03:44 MST

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