1 # DO NOT EDIT - This file is being maintained by Chef
4 cache_mem <%= node[:squid][:cache_mem] %>
6 max_filedescriptors 65536
8 #used by squidclient / munin
15 <% if node[:squid][:version] == "2" -%>
16 http_port 80 accel defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6 http11
18 http_port 80 accel no-vhost defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6
20 #prefer IPv4 until everything is upgraded
24 cache_effective_user proxy
25 cache_effective_group proxy
28 cache_dir <%= node[:squid][:cache_dir] %>
29 <% if node[:squid][:version] == "2" -%>
30 cache_swap_log /var/spool/squid/%s
33 cache_mgr webmaster@openstreetmap.org
40 maximum_object_size 1048576 bytes
41 maximum_object_size_in_memory 64 KB
43 cache_replacement_policy heap LFUDA
44 memory_replacement_policy heap GDSF
46 server_persistent_connections on
47 persistent_request_timeout 1 minutes
49 negative_ttl 15 seconds
50 half_closed_clients off
51 <% if node[:squid][:version] == "2" -%>
57 read_timeout 90 seconds
58 request_timeout 90 seconds
59 connect_timeout 20 seconds
60 client_lifetime 1 hours
62 collapsed_forwarding on
63 <% if node[:squid][:version] == "2" -%>
64 refresh_stale_hit 300 seconds
67 #Recommended minimum configuration:
68 #----------------------------------
69 <% if node[:squid][:version] == "2" -%>
71 acl manager proto cache_object
72 acl localhost src 127.0.0.1/32
73 acl to_localhost dst 127.0.0.0/8
75 acl SSL_ports port 443
76 acl Safe_ports port 80 # http
77 acl Safe_ports port 21 # ftp
78 acl Safe_ports port 443 # https
79 acl Safe_ports port 70 # gopher
80 acl Safe_ports port 210 # wais
81 acl Safe_ports port 1025-65535 # unregistered ports
82 acl Safe_ports port 280 # http-mgmt
83 acl Safe_ports port 488 # gss-http
84 acl Safe_ports port 591 # filemaker
85 acl Safe_ports port 777 # multiling http
86 acl CONNECT method CONNECT
87 http_access allow manager localhost
89 http_access allow manager
91 http_access deny manager
92 http_access deny !Safe_ports
93 http_access deny CONNECT !SSL_ports
94 #----------------------------------
96 acl purge_hosts src 127.0.0.0/8
97 acl PURGE method purge
98 http_access allow purge purge_hosts
99 http_access deny purge
102 follow_x_forwarded_for allow localhost
104 <% if node[:squid][:version] == "2" -%>
105 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
106 access_log <%= node[:squid][:access_log] %>
108 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03>Hs %<st %rm %>rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
109 access_log daemon:<%= node[:squid][:access_log] %>
111 cache_log /var/log/squid/cache.log
115 strip_query_terms off
116 <% if node[:squid][:version] == "3" -%>
117 # Work around bug in squid 3 that causes log_fqdn to be
118 # turned on by some of the (unused by us) default formats:
119 # http://lists.squid-cache.org/pipermail/squid-users/2016-February/thread.html#8999
120 url_rewrite_extras "%>a %un %>rm myip=%la myport=%lp"
121 store_id_extras "%>a %un %>rm myip=%la myport=%lp"
126 refresh_pattern . 0 50% 8640
128 #ZERO required for logrotate to work properly
131 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
132 <%= File.read(file) %>