[squid-users] Controlling Cache Peer
creditu at eml.cc
creditu at eml.cc
Mon Nov 14 01:58:51 UTC 2016
I'm having trouble understanding how to configure an accelerator to
handle multiple IPs and backend servers. In the past we used virtual
IPs and a redirector script to send the requests to a given backend.
Now we need to change to cache peer statements.
Given the following:
Squid listens on:
10.10.10.1 - www.example.com
10.10.10.2 - dev.example.com
For .1, there are 3 backend origin servers.
For .2 there is only 1 backend origin servers.
The following config (right now we need to handle both http and https):
https_port 10.10.10.1:443 accel defaultsite=www.example.com
cert=/etc/squid/www.crt key=/etc/squid/www.key
http_port 10.10.10.1:80 accel defaultsite=www.example.com
# For www.example.com
cache_peer 192.168.1.2 parent 80 0 no-query originserver round-robin
cache_peer 192.168.1.3 parent 80 0 no-query originserver round-robin
cache_peer 192.168.1.4 parent 80 0 no-query originserver round-robin
This seems to work fine for 10.10.10.1 (www.example.com), but I'm stuck
on how to handle 10.10.10.2 (dev.example.com)and tell it to send
requests coming in to a different cach_peer (cache_peer 192.168.0.1
parent 80 0 no-query originserver)?
Just guessing, but can I do something like this along with the above:
https_port 10.10.10.2:443 accel defaultsite=dev.example.com
cert=/etc/squid/www.crt key=/etc/squid/www.key
http_port 10.10.10.2:80 accel defaultsite=dev.example.com
cache_peer 192.168.0.1 parent 80 0 no-query originserver
If so, I'm unsure how to do the ACLs to direct the traffic to the
correct backend servers. Especially since for www.example.com I can not
use the same name= statement for all three backends to construct the
ACLs.
More information about the squid-users
mailing list