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 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 refresh_stale_hit 300 seconds
65 #Recommended minimum configuration:
66 #----------------------------------
68 acl manager proto cache_object
69 acl localhost src 127.0.0.1/32
70 acl to_localhost dst 127.0.0.0/8
71 acl SSL_ports port 443
72 acl Safe_ports port 80 # http
73 acl Safe_ports port 21 # ftp
74 acl Safe_ports port 443 # https
75 acl Safe_ports port 70 # gopher
76 acl Safe_ports port 210 # wais
77 acl Safe_ports port 1025-65535 # unregistered ports
78 acl Safe_ports port 280 # http-mgmt
79 acl Safe_ports port 488 # gss-http
80 acl Safe_ports port 591 # filemaker
81 acl Safe_ports port 777 # multiling http
82 acl CONNECT method CONNECT
83 http_access allow manager localhost
85 http_access allow manager
87 http_access deny manager
88 http_access deny !Safe_ports
89 http_access deny CONNECT !SSL_ports
90 #----------------------------------
92 acl purge_hosts src 127.0.0.0/8
93 acl PURGE method purge
94 http_access allow purge purge_hosts
95 http_access deny purge
98 follow_x_forwarded_for allow localhost
100 <% if node[:squid][:version] == "2" -%>
101 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
102 access_log <%= node[:squid][:access_log] %>
104 logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03>Hs %<st %rm %>rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
105 access_log daemon:<%= node[:squid][:access_log] %>
107 cache_log /var/log/squid/cache.log
111 strip_query_terms off
115 refresh_pattern . 0 50% 8640
117 #ZERO required for logrotate to work properly
120 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
121 <%= File.read(file) %>