Aleksey Zvyagin wrote:
>
> Hi!
>
> I have squid 2.3-STABLE4
> How can i configure a squid (accelerator mode) that it sends corrected
> "Host:" header to my localhost's httpd server?
>
> For example:
> My apache server listens the 127.0.0.1:80 and has a lot virtual servers at
> one IP address, e.g. 127.0.0.1
> In this time squid is running at this server and listens IP_provider:80
> I have following lines in squid.conf:
>
> httpd_accel_host 127.0.0.1
> httpd_accel_port 80
> httpd_accel_uses_host_header off
>
> If a client connects to IP_provider:80 and requests as:
> GET / HTTP/1.0
> Host: some.my.host
>
> Then the squid requests the 127.0.0.1:80 server as:
> GET / HTTP/1.0
> Host: 127.0.0.1
>
> But i need the "Host: some.my.host"
My preferred setup for accelerators is:
1. Build Squid with --disable-internal-dns
2. configure /etc/nsswitch.conf to first look in /etc/hosts and then DNS
3. Add all the web domains to /etc/hosts, with the IP address where the
real web server listens
3a. Verify with lynx or some other web browser running on the proxy
server that it can reach the real servers by using the domain names.
4. Configure squid.conf like this:
httpd_accel_host your.main.domain
httpd_accel_uses_host_header on
httpd_accel_port 80
http_port your.official.ip:80
acl backend_servers ip.of.the.real.web.server
acl http port 80
http_access allow backend_servers http
http_access deny all
[and any other options you need for cache and so on]
This setup is quite easy and ver flexible. If you later find that you
want to include one or more other web servers in the accelerator setup
then all you need to do is to add the domains hosted on those servers to
/etc/hosts and the backend_servers ACL, and Squid will be happy and
secure.
-- Henrik Nordstrom Squid hacker -- To unsubscribe, see http://www.squid-cache.org/mailing-lists.htmlReceived on Thu Dec 14 2000 - 22:54:11 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:56:58 MST