On Friday 08 August 2003 02.35, Jim Flowers wrote: > Yes, by definition name-based hosts use the same ip number but have > different host.domain.tlds. If I use only one cache_peer line, how > do I configure more than one name-based virtual host on the server > with that ip address?
It is all automatic unless you rewrite the host component of the request via a redirector or forcing the domain in cache_peer... Which domains to send to which origin server is controlled by cache_peer_access. A small example of a Squid-3 accelerator setup with one virtual host based port 80, forwarding 4 domains to 2 different servers (2 domains per server) with a default domain for old clients not supporting the host header. http_port 80 accel vhost defaultsite=www.example.com cache_peer 192.0.2.54 parent 80 0 no-query originserver name=vhost1 acl vhosts1_domains dstdomain www.example.com partners.example.com cache_peer_access vhost1 allow vhost1_domains http_access allow vhost1_domains cache_peer 192.0.2.60 parent 80 0 no-query originserver name=vhost2 acl vhosts2_domains dstdomain bugs.example.com support.example.com cache_peer_access vhost2 allow vhost2_domains http_access allow vhost2_domains If the domains to pass to the origin web servers is different from what the end-user requests in his web browser then the preferred solution is to fix the origin servers to accept the official domains requested by the end user. Alternatively you can use a redirector to rewrite the URL while it is forwarded by Squid but this approach will give you problems with most applications where the origin server will sometimes try to redirect or send the end-user to the domain the origin server thinks is the correct domain name for the server.. If you use the redirectror approach then the domains to use in http_access will be the external domains, while cache_peer_access uses the internal domains (after redirector rewriting of the URL). Regards Henrik -- Donations welcome if you consider my Free Squid support helpful. https://www.paypal.com/xclick/business=hno%40squid-cache.org If you need commercial Squid support or cost effective Squid or firewall appliances please refer to MARA Systems AB, Sweden http://www.marasystems.com/, [EMAIL PROTECTED]
