1 # DO NOT EDIT - This file is being maintained by Chef
4 visible_hostname <%= node.name %>
7 cache_mem <%= node[:squid][:cache_mem] %>
8 <% if node[:squid][:version] > 2 -%>
10 workers <%= node[:cpu][:total] %>
12 error_log_languages off
15 max_filedescriptors 98304
17 #used by squidclient / munin
26 <% if node[:squid][:version] < 3 -%>
27 http_port 80 accel defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6 http11
29 http_port 80 accel no-vhost defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6
32 cache_effective_user proxy
33 cache_effective_group proxy
36 <% Array(node[:squid][:cache_dir]).each do |cache_dir| -%>
37 cache_dir <%= cache_dir %>
39 <% if node[:squid][:version] < 3 -%>
40 cache_swap_log /var/spool/squid/%s
43 cache_mgr webmaster@openstreetmap.org
50 maximum_object_size 1048576 bytes
51 maximum_object_size_in_memory 64 KB
53 cache_replacement_policy heap LFUDA
54 memory_replacement_policy heap GDSF
56 server_persistent_connections on
57 <% if node[:squid][:version] < 3 -%>
58 persistent_request_timeout 1 minutes
60 client_idle_pconn_timeout 1 minutes
62 <% if node[:squid][:version] > 3 -%>
63 pconn_lifetime 5 minutes
66 negative_ttl 15 seconds
67 half_closed_clients off
68 <% if node[:squid][:version] < 3 -%>
74 read_timeout 90 seconds
75 request_timeout 90 seconds
76 connect_timeout 20 seconds
77 client_lifetime 1 hours
79 <% if node[:squid][:version] < 4 -%>
80 collapsed_forwarding on
82 <% if node[:squid][:version] < 3 -%>
83 refresh_stale_hit 300 seconds
86 #Recommended minimum configuration:
87 #----------------------------------
88 <% if node[:squid][:version] < 3 -%>
90 acl manager proto cache_object
91 acl localhost src 127.0.0.1/32
92 acl to_localhost dst 127.0.0.0/8
94 acl SSL_ports port 443
95 acl Safe_ports port 80 # http
96 acl Safe_ports port 21 # ftp
97 acl Safe_ports port 443 # https
98 acl Safe_ports port 70 # gopher
99 acl Safe_ports port 210 # wais
100 acl Safe_ports port 1025-65535 # unregistered ports
101 acl Safe_ports port 280 # http-mgmt
102 acl Safe_ports port 488 # gss-http
103 acl Safe_ports port 591 # filemaker
104 acl Safe_ports port 777 # multiling http
105 acl CONNECT method CONNECT
106 http_access allow manager localhost
108 http_access allow manager
110 http_access deny manager
111 http_access deny !Safe_ports
112 http_access deny CONNECT !SSL_ports
113 #----------------------------------
115 acl purge_hosts src 127.0.0.0/8
116 acl PURGE method purge
117 http_access allow purge purge_hosts
118 http_access deny purge
121 follow_x_forwarded_for allow localhost
123 <% if node[:squid][:version] < 3 -%>
124 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
125 access_log <%= node[:squid][:access_log] %>
127 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03>Hs %<st %rm %>rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
128 access_log daemon:<%= node[:squid][:access_log] %>
130 cache_log /var/log/squid/cache.log
134 strip_query_terms off
135 <% if node[:squid][:version] > 2 -%>
136 # Work around bug in squid 3 that causes log_fqdn to be
137 # turned on by some of the (unused by us) default formats:
138 # http://lists.squid-cache.org/pipermail/squid-users/2016-February/thread.html#8999
139 url_rewrite_extras "%>a %un %>rm myip=%la myport=%lp"
140 store_id_extras "%>a %un %>rm myip=%la myport=%lp"
145 refresh_pattern . 0 50% 8640
147 #ZERO required for logrotate to work properly
150 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
151 <%= File.read(file) %>