Add nginx caching support + enable for imagery
[chef.git] / cookbooks / nginx / templates / default / nginx.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 user  www-data;
4 worker_processes <%= node['cpu']['total'] %>;
5 worker_rlimit_nofile 65536;
6
7 error_log  /var/log/nginx/error.log warn;
8 pid        /var/run/nginx.pid;
9
10
11 events {
12     worker_connections  1024;
13 }
14
15 http {
16     include       /etc/nginx/mime.types;
17     default_type  application/octet-stream;
18
19     server_names_hash_bucket_size 128;
20
21     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
22                       '$status $body_bytes_sent "$http_referer" '
23                       '"$http_user_agent" "$http_x_forwarded_for"';
24
25     access_log  /var/log/nginx/access.log  main  buffer=32k flush=1m;
26
27     keepalive_timeout  65;
28
29     server_tokens off;
30
31     <% if node['nginx']['cache']['fastcgi']['enable'] -%>
32     fastcgi_cache_path /var/lib/nginx/fastcgi-cache levels=1:2 keys_zone=<%= node['nginx']['cache']['fastcgi']['keys_zone'] %> inactive=<%= node['nginx']['cache']['fastcgi']['inactive'] %> max_size=<%= node['nginx']['cache']['fastcgi']['max_size'] %>;
33     <% end -%>
34     <% if node['nginx']['cache']['proxy']['enable'] -%>
35     fastcgi_cache_path /var/lib/nginx/proxy-cache levels=1:2 keys_zone=<%= node['nginx']['cache']['proxy']['keys_zone'] %> inactive=<%= node['nginx']['cache']['proxy']['inactive'] %> max_size=<%= node['nginx']['cache']['proxy']['max_size'] %>;
36     <% end -%>
37
38     include /etc/nginx/conf.d/*.conf;
39 }