]> git.openstreetmap.org Git - chef.git/blob - cookbooks/squid/templates/default/squid.conf.erb
e615f887bf2b5167cc0e23d467afaaa77338a2d3
[chef.git] / cookbooks / squid / templates / default / squid.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 #FIXME - configurable
4 cache_mem  <%= node[:squid][:cache_mem] %>
5
6 max_filedescriptors 65536
7
8 #used by squidclient / munin
9 http_port 3128
10 #ICP
11 icp_port 3130
12
13 #FIXME - configurable
14 http_port 80 accel defaultsite=tile.openstreetmap.org tcpkeepalive=60,10,6 http11
15
16 cache_effective_user proxy
17 cache_effective_group proxy
18
19 #FIXME - configurable
20 cache_dir <%= node[:squid][:cache_dir] %>
21 cache_swap_log /var/spool/squid/%s
22
23 quick_abort_min 0 KB
24 quick_abort_max 0 KB
25
26 read_ahead_gap 64 KB
27
28 maximum_object_size 1048576 bytes
29 maximum_object_size_in_memory 64 KB
30
31 cache_replacement_policy heap LFUDA
32 memory_replacement_policy heap GDSF
33
34 server_persistent_connections on
35 persistent_request_timeout 1 minutes
36
37 negative_ttl 15 seconds
38 half_closed_clients off
39 pipeline_prefetch on
40
41 read_timeout 90 seconds
42 request_timeout 90 seconds
43 connect_timeout 20 seconds
44 client_lifetime 1 hours
45
46 collapsed_forwarding on
47 refresh_stale_hit 300 seconds
48
49 #Recommended minimum configuration:
50 #----------------------------------
51 acl all src all
52 acl manager proto cache_object
53 acl localhost src 127.0.0.1/32
54 acl to_localhost dst 127.0.0.0/8
55 acl SSL_ports port 443
56 acl Safe_ports port 80          # http
57 acl Safe_ports port 21          # ftp
58 acl Safe_ports port 443         # https
59 acl Safe_ports port 70          # gopher
60 acl Safe_ports port 210         # wais
61 acl Safe_ports port 1025-65535  # unregistered ports
62 acl Safe_ports port 280         # http-mgmt
63 acl Safe_ports port 488         # gss-http
64 acl Safe_ports port 591         # filemaker
65 acl Safe_ports port 777         # multiling http
66 acl CONNECT method CONNECT
67 http_access allow manager localhost
68
69 http_access allow manager
70
71 http_access deny manager
72 http_access deny !Safe_ports
73 http_access deny CONNECT !SSL_ports
74 #----------------------------------
75
76 acl purge_hosts src 127.0.0.0/8
77 acl PURGE method purge
78 http_access allow purge purge_hosts
79 http_access deny purge
80
81 forwarded_for on
82
83 #Loggin used for analysis
84 logformat zerelog %ts.%03tu %rp "%{Etag}<h" %>a "%{User-Agent}>h"
85 access_log /var/log/squid/zere.log zerelog
86
87 access_log <%= node[:squid][:access_log] %>
88 cache_log /var/log/squid/cache.log
89 cache_store_log none
90 buffered_logs on
91 client_db off
92 strip_query_terms off
93
94 digest_generation on
95
96 refresh_pattern .               0       20%     4320
97
98 #ZERO required for logrotate to work properly
99 logfile_rotate 0
100
101 <% Dir.glob("/etc/squid/squid.conf.d/*.conf") do |file| -%>
102 <%= File.read(file) %>
103 <% end -%>
104
105 #MUST BE LAST ACL
106 #--------------
107 http_access deny all
108 icp_access deny all
109 #--------------
110