Re: httpd_accelerator mode and virtual hosts

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 14 Sep 1999 22:59:04 +0200

Nick Urbanik wrote:

> > This is done via a redirector which splits the received URL space to two
> > (or more) backend URL spaces.
>
> I guess squirm might do the job here, with squirm.local set to allow all
> hosts. (Yes? No?)

Never used Squirm or studied it in detail, but I guess it can be used.

The redirector used needs to be able to rewrite URL's. Personally I uses
simple perl scripts. The job of accelerator redirectors is usually very
simple and well defined.

> > httpd_accel_host virual is when you need one Squid to accelerate
> > multiple official IP servers. It is not needed for Host: based virtual
> > servers.
>
> I'm still not clear here. Does that mean that the Squid machine has a
> number of IP addresses, and a request is somehow (how?) transformed into a
> request to a particular web server?

Yes, or actually transformed into unique URLs depending on which IP
address the request was received on. It is then the job of a redirector
to transform the requests to requests for backend servers.

> > httpd_accel_uses_host_header tells Squid to look for a Host header on
> > accelerated requests and use that as host part in the reconstructed URL
> > if available.
>
> I imagine that this is really the only solution (together with the
> redirector, such as squirm). Yes? No?

That is the common situation, where you only need to publish one IP
address, and hang several other domains off that IP address.

> > httpd_accel_hosts tells Squid what to use if there is no Host header
> > available (or if httpd_accel_uses_host_header isn't used). If a hostname
> > is configured then Squid will assume the request is for this host.
>
> Can there be only one httpd_accel_host entry in squid.conf? If so, then
> does that mean it is not possible to help me?

Yes, there can only be one httpd_accel_host entry in squid.conf. It
should be set to the default site name.

> This part (httpd_accel_host virtual) I do not understand. How does Squid
> reconstruct the request?

By using the IP address of the receiving interface.

The received url-path gets transformed to the absolute URL
http://1.2.3.4/url-path
[where 1.2.3.4 is the IP address of the receiving interface]

httpd_accel_host is analogous to the default site on a HTTP server
httpd_accel_uses_host_header is analogous to enabling domain based
virtual servers on a HTTP server.

One single Internet IP address can only support one default HTTP site
and any number of domain based virtual sites.

In the case of Squid acceleration a site is a published URL-path space
(URL excluding hostname/port) from the accelerator.

Redirectors can be used to have any transformation you like between the
published URL space and backend servers URL space.

--
Henrik Nordstrom
Spare time Squid hacker
Received on Tue Sep 14 1999 - 15:54:26 MDT

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