1 # DO NOT EDIT - This file is being maintained by Chef
4 visible_hostname <%= node.name %>
7 cache_mem <%= node[:squid][:cache_mem] %>
9 max_filedescriptors 98304
11 #used by squidclient / munin
18 <% if node[:squid][:version] < 3 -%>
19 http_port 80 accel defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6 http11
21 http_port 80 accel no-vhost defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6
24 cache_effective_user proxy
25 cache_effective_group proxy
28 <% Array(node[:squid][:cache_dir]).each do |cache_dir| -%>
29 cache_dir <%= cache_dir %>
31 <% if node[:squid][:version] < 3 -%>
32 cache_swap_log /var/spool/squid/%s
35 cache_mgr webmaster@openstreetmap.org
42 maximum_object_size 1048576 bytes
43 maximum_object_size_in_memory 64 KB
45 cache_replacement_policy heap LFUDA
46 memory_replacement_policy heap GDSF
48 server_persistent_connections on
49 <% if node[:squid][:version] < 3 -%>
50 persistent_request_timeout 1 minutes
52 client_idle_pconn_timeout 1 minutes
55 negative_ttl 15 seconds
56 half_closed_clients off
57 <% if node[:squid][:version] < 3 -%>
63 read_timeout 90 seconds
64 request_timeout 90 seconds
65 connect_timeout 20 seconds
66 client_lifetime 1 hours
68 <% if node[:squid][:version] < 4 -%>
69 collapsed_forwarding on
71 <% if node[:squid][:version] < 3 -%>
72 refresh_stale_hit 300 seconds
75 #Recommended minimum configuration:
76 #----------------------------------
77 <% if node[:squid][:version] < 3 -%>
79 acl manager proto cache_object
80 acl localhost src 127.0.0.1/32
81 acl to_localhost dst 127.0.0.0/8
83 acl SSL_ports port 443
84 acl Safe_ports port 80 # http
85 acl Safe_ports port 21 # ftp
86 acl Safe_ports port 443 # https
87 acl Safe_ports port 70 # gopher
88 acl Safe_ports port 210 # wais
89 acl Safe_ports port 1025-65535 # unregistered ports
90 acl Safe_ports port 280 # http-mgmt
91 acl Safe_ports port 488 # gss-http
92 acl Safe_ports port 591 # filemaker
93 acl Safe_ports port 777 # multiling http
94 acl CONNECT method CONNECT
95 http_access allow manager localhost
97 http_access allow manager
99 http_access deny manager
100 http_access deny !Safe_ports
101 http_access deny CONNECT !SSL_ports
102 #----------------------------------
104 acl purge_hosts src 127.0.0.0/8
105 acl PURGE method purge
106 http_access allow purge purge_hosts
107 http_access deny purge
110 follow_x_forwarded_for allow localhost
112 <% if node[:squid][:version] < 3 -%>
113 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
114 access_log <%= node[:squid][:access_log] %>
116 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03>Hs %<st %rm %>rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
117 access_log daemon:<%= node[:squid][:access_log] %>
119 cache_log /var/log/squid/cache.log
123 strip_query_terms off
124 <% if node[:squid][:version] > 2 -%>
125 # Work around bug in squid 3 that causes log_fqdn to be
126 # turned on by some of the (unused by us) default formats:
127 # http://lists.squid-cache.org/pipermail/squid-users/2016-February/thread.html#8999
128 url_rewrite_extras "%>a %un %>rm myip=%la myport=%lp"
129 store_id_extras "%>a %un %>rm myip=%la myport=%lp"
134 refresh_pattern . 0 50% 8640
136 #ZERO required for logrotate to work properly
139 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
140 <%= File.read(file) %>