[SQU] accelerator with name-based virtual host

From: Steven Haryanto <steven@dont-contact.us>
Date: Mon, 25 Dec 2000 11:30:03 +0700

I am having problem setting up squid as a front-end proxy
for Apache.

The Apache listens only at 127.0.0.1 because I prefer it to
be untouchable from the network. The port is 1080. It has
several name-based virtual hosts. A section from httpd.conf:

  namevirtualhost 127.0.0.1
  <virtualhost 127.0.0.1>
    servername site1.com
    serveralias *.site1.com
    documentroot /usr/local/apache/vhost/site1
  </virtualhost>
  <virtualhost 127.0.0.1>
    servername site2.com
    serveralias *.site2.com
    documentroot /usr/local/apache/vhost/site2
  </virtualhost>
  # ...

*.site1.com, *.site2.com, etc., resolves to external IPs.

Squid sits on port 80 and binds to all those external IPs,
and I have these values set in squid.conf:

  http_port 80
  httpd_accel_host 127.0.0.1
  httpd_accel_port 1080
  httpd_accel_uses_host_header off

What I would like is to have Squid:

- always connect to 127.0.0.1, no matter to what site the
   request is directed. That is, if a user typed in
   http://site1.com/ into their browser, Squid would forward
   it to 127.0.0.1:1080, not to the IP of site1.com (e.g:
   12.34.56.78:1080).

- pass the original host in the Host: header through
   unchanged, so Apache can process it and select the
   appropriate virtual host. I have turned off
   'redirect_rewrites_host_header' but Squid still seems to
   modify it. That is, if the original request was to
   site1.com, Squid passed the Host: header as
   12.34.56.78:1080, not site1.com:1080 that I wanted.

Squid version is 2.3STABLE4.

If someone could shed a light on this before I try to get
my hands on squid's source code, that would be appreciated.

Thanks,
Steve

--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Sun Dec 24 2000 - 21:26:17 MST

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