# Tuning for nginx fastcgi cache zone
default[:nginx][:cache][:fastcgi][:enable] = false
+default[:nginx][:cache][:fastcgi][:directory] = "/var/cache/nginx/fastcgi-cache"
default[:nginx][:cache][:fastcgi][:keys_zone] = "fastcgi_cache_zone:48M"
default[:nginx][:cache][:fastcgi][:inactive] = "45d"
default[:nginx][:cache][:fastcgi][:max_size] = "8192M"
# Tuning for nginx proxy cache zone
default[:nginx][:cache][:proxy][:enable] = false
+default[:nginx][:cache][:proxy][:directory] = "/var/cache/nginx/proxy-cache"
default[:nginx][:cache][:proxy][:keys_zone] = "proxy_cache_zone:48M"
default[:nginx][:cache][:proxy][:inactive] = "45d"
default[:nginx][:cache][:proxy][:max_size] = "8192M"
variables :resolvers => resolvers
end
-directory "/var/cache/nginx/fastcgi-cache" do
+directory node[:nginx][:cache][:fastcgi][:directory] do
owner "www-data"
group "root"
mode 0o755
+ recursive true
only_if { node[:nginx][:cache][:fastcgi][:enable] }
end
-directory "/var/cache/nginx/proxy-cache" do
+directory node[:nginx][:cache][:proxy][:directory] do
owner "www-data"
group "root"
mode 0o755
+ recursive true
only_if { node[:nginx][:cache][:proxy][:enable] }
end
resolver_timeout 5s;
<% if node['nginx']['cache']['fastcgi']['enable'] -%>
- fastcgi_cache_path /var/cache/nginx/fastcgi-cache levels=2:2:2 use_temp_path=off keys_zone=<%= node['nginx']['cache']['fastcgi']['keys_zone'] %> inactive=<%= node['nginx']['cache']['fastcgi']['inactive'] %> max_size=<%= node['nginx']['cache']['fastcgi']['max_size'] %>;
+ fastcgi_cache_path <%= node['nginx']['cache']['fastcgi']['directory'] %> levels=2:2:2 use_temp_path=off keys_zone=<%= node['nginx']['cache']['fastcgi']['keys_zone'] %> inactive=<%= node['nginx']['cache']['fastcgi']['inactive'] %> max_size=<%= node['nginx']['cache']['fastcgi']['max_size'] %>;
<% end -%>
<% if node['nginx']['cache']['proxy']['enable'] -%>
- proxy_cache_path /var/cache/nginx/proxy-cache levels=2:2:2 use_temp_path=off keys_zone=<%= node['nginx']['cache']['proxy']['keys_zone'] %> inactive=<%= node['nginx']['cache']['proxy']['inactive'] %> max_size=<%= node['nginx']['cache']['proxy']['max_size'] %>;
+ proxy_cache_path <%= node['nginx']['cache']['proxy']['directory'] %> levels=2:2:2 use_temp_path=off keys_zone=<%= node['nginx']['cache']['proxy']['keys_zone'] %> inactive=<%= node['nginx']['cache']['proxy']['inactive'] %> max_size=<%= node['nginx']['cache']['proxy']['max_size'] %>;
<% end -%>
# Internal site for munin monitoring
:cache_mem => "12500 MB",
:cache_dir => "coss /store/squid/coss-01 128000 block-size=8192 max-size=262144 membufs=80"
},
+ :nginx => {
+ :cache => {
+ :proxy => {
+ :directory => "/store/nginx-cache/proxy-cache"
+ }
+ }
+ },
:tilecache => {
:tile_parent => "hsinchu.render.openstreetmap.org",
:tile_siblings => [