1 # DO NOT EDIT - This file is being maintained by Chef
4 cache_mem <%= node[:squid][:cache_mem] %>
6 max_filedescriptors 98304
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 <% Array(node[:squid][:cache_dir]).each do |cache_dir| -%>
29 cache_dir <%= cache_dir %>
31 <% if node[:squid][:version] == "2" -%>
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 persistent_request_timeout 1 minutes
51 negative_ttl 15 seconds
52 half_closed_clients off
53 <% if node[:squid][:version] == "2" -%>
59 read_timeout 90 seconds
60 request_timeout 90 seconds
61 connect_timeout 20 seconds
62 client_lifetime 1 hours
64 collapsed_forwarding on
65 <% if node[:squid][:version] == "2" -%>
66 refresh_stale_hit 300 seconds
69 #Recommended minimum configuration:
70 #----------------------------------
71 <% if node[:squid][:version] == "2" -%>
73 acl manager proto cache_object
74 acl localhost src 127.0.0.1/32
75 acl to_localhost dst 127.0.0.0/8
77 acl SSL_ports port 443
78 acl Safe_ports port 80 # http
79 acl Safe_ports port 21 # ftp
80 acl Safe_ports port 443 # https
81 acl Safe_ports port 70 # gopher
82 acl Safe_ports port 210 # wais
83 acl Safe_ports port 1025-65535 # unregistered ports
84 acl Safe_ports port 280 # http-mgmt
85 acl Safe_ports port 488 # gss-http
86 acl Safe_ports port 591 # filemaker
87 acl Safe_ports port 777 # multiling http
88 acl CONNECT method CONNECT
89 http_access allow manager localhost
91 http_access allow manager
93 http_access deny manager
94 http_access deny !Safe_ports
95 http_access deny CONNECT !SSL_ports
96 #----------------------------------
98 acl purge_hosts src 127.0.0.0/8
99 acl PURGE method purge
100 http_access allow purge purge_hosts
101 http_access deny purge
104 follow_x_forwarded_for allow localhost
106 <% if node[:squid][:version] == "2" -%>
107 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
108 access_log <%= node[:squid][:access_log] %>
110 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03>Hs %<st %rm %>rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
111 access_log daemon:<%= node[:squid][:access_log] %>
113 cache_log /var/log/squid/cache.log
117 strip_query_terms off
118 <% if node[:squid][:version] == "3" -%>
119 # Work around bug in squid 3 that causes log_fqdn to be
120 # turned on by some of the (unused by us) default formats:
121 # http://lists.squid-cache.org/pipermail/squid-users/2016-February/thread.html#8999
122 url_rewrite_extras "%>a %un %>rm myip=%la myport=%lp"
123 store_id_extras "%>a %un %>rm myip=%la myport=%lp"
128 refresh_pattern . 0 50% 8640
130 #ZERO required for logrotate to work properly
133 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
134 <%= File.read(file) %>