Re: [squid-users] Multiple hostnames passed onto backend

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Thu, 10 Jul 2008 21:32:55 +0200

On tor, 2008-07-10 at 09:34 -0700, orcadk wrote:

> Now, I can get Squid to do this for a single domain with just a couple of
> settings:
> http_port 80 accel defaultsite=customerx.mysite.com
> cache_peer [internal_ip] 80 0 no-query originserver=customerx_server
>
> However, I need to get this working for all the customer sites. The customer
> sites themselves may be put on different servers. Basically I need to make a
> map saying customerx.squid.mysite.com -> customerx.mysite.com, but for an
> arbitrary amount of hostnames.
>
> Any suggestions on how to do this?

You need a cache_peer per server, and cache_peer_access/domain selecting
what gets sent to each server.

Alternatively you can use the allow-direct option on http_port, a small
url rewriter to map the server names back to the customer servers and
carefully configured http_access rules to not allow any other traffic..
(no cache_peer lines in this config mode)

### CUT HERE ###
#!/usr/bin/perl -p
BEGIN { $|=1; }
s%\.squid\.mysite\.com%mysite.com%i;
### END CUT ###

this script maps anything.squid.mysite.com to anything.mysite.com

Regards
Henrik

Received on Thu Jul 10 2008 - 19:33:02 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 11 2008 - 12:00:03 MDT