Re: [squid-users] DNS configuration

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Tue, 22 Jul 2008 00:36:44 +0200

On mån, 2008-07-21 at 15:18 -0700, elsergio wrote:

> I am trying to configure a reverse proxy. The idea is to have several web
> servers in my network and also a DNS. The dns server will have the planning
> logic for choosing the optimal web server. I want Squid to ask for the web
> server ip address to this dns server. Then Squid will forward the request to
> the given ip.
>
> It is possible to do this? If this is possible,. how can I do it?

Yes, if you accept that peering with other Squids is not possible.

http_port 80 accel vhost

always_direct allow all

acl my.servers dstdomain site1.domain site2.domain ...
acl http proto http
acl 80 port 80

http_access allow my.servers http 80
http_access deny all

and make the DNS return a very very short TTL for sites where you do
dynamic serverselection.. (if not squid will cache the DNS response for
as long as it's valid).

Byt personally I would let Squid do the server selection, with the
seletion logics in squid.conf.

http_port 80 accel vhost

cache_peer ip.of.server1 parent 80 0 no-query originserver name=server1
acl server1_domains dstdomain site1.domain
cache_peer_access allow server1 server1_domains

cache_peer ip.of.server2 parent 80 0 no-query originserver name=server2
acl server2_domains dstdomain site2.domain
cache_peer_access allow server2 server2_domains

[etc]

If you have multple servers for the same sites add multiple cache_peer
lines, and a peer seletion algorithm such as round-robin,
weighted-round-robin, sourcehash, userhash or carp.

If there is very many domains hosted per server then use file based acls

acl serverX_domains dstdomain "/path/to/server1_domains.txt"

Regards
Henrik

Received on Mon Jul 21 2008 - 22:36:51 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 22 2008 - 12:00:04 MDT