+# Tuning for access logging
+default[:nginx][:access_log] = "/var/log/nginx/access.log"
+
# Tuning for nginx fastcgi cache zone
default[:nginx][:cache][:fastcgi][:enable] = false
default[:nginx][:cache][:fastcgi][:keys_zone] = "fastcgi_cache_zone:32M"
server_names_hash_bucket_size 128;
+<% if node[:nginx][:access_log] -%>
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log main buffer=32k flush=1m;
+ access_log <%= node[:nginx][:access_log] %> main buffer=32k flush=1m;
+<% end -%>
keepalive_timeout 65;
default[:squid][:cache_mem] = "256 MB"
default[:squid][:cache_dir] = "ufs /var/spool/squid 256 16 256"
-default[:squid][:access_log] = "/var/log/squid/access.log squid"
+default[:squid][:access_log] = "/var/log/squid/access.log openstreetmap"
munin_plugin "squid_objectsize"
munin_plugin "squid_requests"
munin_plugin "squid_traffic"
+
+Dir.glob("/var/log/squid/zere.log*") do |log|
+ File.unlink(log)
+end
forwarded_for on
follow_x_forwarded_for allow localhost
-#Loggin used for analysis
-logformat zerelog %ts.%03tu %rp "%{Etag}<h" %>a "%{User-Agent}>h" %<st
-access_log /var/log/squid/zere.log zerelog
-
+logformat openstreetmap %ts.%03tu %tr %>a %Ss/%03Hs %<st %rm %rp %Sh/%<A %mt "%{Referer}>h" "%{User-Agent}>h"
access_log <%= node[:squid][:access_log] %>
cache_log /var/log/squid/cache.log
cache_store_log none
conf_variables :host => render[:fqdn]
end
end
+
+Dir.glob("/var/log/nginx/access.log*") do |log|
+ File.unlink(log)
+end
test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
endscript
lastaction
- /usr/bin/rsync --preallocate /var/log/squid/zere.log.1.xz ironbelly::logs/tile.openstreetmap.org/<%= node[:hostname] %>-`date -d "-1 days" +%Y-%m-%d`.xz || true
+ /usr/bin/rsync --preallocate /var/log/squid/access.log.1.xz ironbelly::logs/tile.openstreetmap.org/<%= node[:hostname] %>-`date -d "-1 days" +%Y-%m-%d`.xz || true
endscript
}
:apt => {
:sources => ["nginx"]
},
+ :nginx => {
+ :access_log => nil
+ },
:sysctl => {
:network_conntrack_time_wait => {
:comment => "Only track completed connections for 30 seconds",