[squid-users] Sibling cache_peer inside docker containers

interwebbot dasknkt+squid at gmail.com
Fri Apr 26 00:00:18 UTC 2019


I have 2 squid instances running inside docker containers on the same host. I
am trying to set these two instances as cache_peer siblings for storage
optimization. Here is the config I am using:



http_port 3128

acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged)
machines
acl squid-(1/2)  src 172.17.0.(2/3)
acl SSL_ports port 443

acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl Safe_ports port 1025-65535  # unregistered ports

acl CONNECT method CONNECT

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

http_access allow localnet
http_access allow localhost
http_access allow squid-2
http_access deny all

coredump_dir /squid/var/cache/squid

icp_port 3130
cache_peer 172.17.0.(2/3) sibling 3128 3130 default #proxy-only
prefer_direct off
icp_access allow all
icp_query_timeout 500
debug_options ALL,1 12,5 42,3

refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

cache_store_log /var/log/squid/store.log


To test if this is working, I am trying the following test:
 > curl -x http://127.0.0.1:3131 -L http://example.com (this results in a
MISS from squid-1 as expected)
 > curl -x http://127.0.0.1:3131 -L http://example.com (this results in a
HIT from squid-1 as expected)

 > curl -x http://127.0.0.1:3132 -L http://example.com (this results in a
MISS from squid-2. NOT EXPECTED)

Am I correct in assuming that last curl should result in a HIT instead of
MISS? If yes, what is wrong with my config?

Thanks in advance



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html


More information about the squid-users mailing list