|
| 1 | +# |
| 2 | +# Based on combination of configs from |
| 3 | +# - https://github.com/stackhpc/docker-squid/blob/master/squid.conf |
| 4 | +# - https://github.com/drosskopp/squid-cache/blob/main/squid.conf |
| 5 | +# |
| 6 | + |
| 7 | +# Define ACLs: |
| 8 | +{{ squid_acls }} |
| 9 | + |
| 10 | +acl SSL_ports port 443 |
| 11 | +acl Safe_ports port 80 # http |
| 12 | +acl Safe_ports port 21 # ftp |
| 13 | +acl Safe_ports port 443 # https |
| 14 | +acl Safe_ports port 70 # gopher |
| 15 | +acl Safe_ports port 210 # wais |
| 16 | +acl Safe_ports port 1025-65535 # unregistered ports |
| 17 | +acl Safe_ports port 280 # http-mgmt |
| 18 | +acl Safe_ports port 488 # gss-http |
| 19 | +acl Safe_ports port 591 # filemaker |
| 20 | +acl Safe_ports port 777 # multiling http |
| 21 | +acl CONNECT method CONNECT |
| 22 | + |
| 23 | +# Rules allowing http access |
| 24 | +{{ squid_http_access}} |
| 25 | + |
| 26 | +# Squid normally listens to port 3128 |
| 27 | +http_port {{ squid_http_port }} |
| 28 | + |
| 29 | +# Define cache parameters: |
| 30 | +cache_dir ufs /var/spool/squid {{ squid_cache_disk | int }} 16 256 |
| 31 | +cache_mem {{ squid_cache_mem }} |
| 32 | +maximum_object_size_in_memory {{ squid_maximum_object_size_in_memory }} |
| 33 | +maximum_object_size {{ squid_maximum_object_size }} |
| 34 | + |
| 35 | +# Keep largest objects around longer: |
| 36 | +cache_replacement_policy heap LFUDA |
| 37 | + |
| 38 | +memory_replacement_policy heap GDSF |
| 39 | + |
| 40 | +# Leave coredumps in the first cache dir |
| 41 | +coredump_dir /var/spool/squid |
| 42 | + |
| 43 | +# Configure refresh |
| 44 | +# cache repodata only few minutes and then query parent whether it is fresh: |
| 45 | +refresh_pattern /XMLRPC/GET-REQ/.*/repodata/.*$ 0 1% 1440 ignore-no-cache reload-into-ims refresh-ims |
| 46 | +# rpm will hardly ever change, force it to cache for very long time: |
| 47 | +refresh_pattern \.rpm$ 10080 100% 525960 override-expire override-lastmod ignore-reload reload-into-ims |
| 48 | +refresh_pattern ^ftp: 1440 20% 10080 |
| 49 | +refresh_pattern ^gopher: 1440 0% 1440 |
| 50 | +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 |
| 51 | +refresh_pattern . 0 20% 4320 |
| 52 | + |
| 53 | +# Disable squid doing logfile rotation as the RockyLinux dnf package configures logrotate |
| 54 | +logfile_rotate 0 |
0 commit comments