diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-10-26 16:02:59 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-10-26 16:02:59 -0200 |
commit | 68890c0f2bf8387b1d2fe9d0eef46f39f593d404 (patch) | |
tree | e469261f27cb6ddf64fabac667e0162d3ca8d625 | |
parent | 4f7016c074f6e1d5b554d541ff5d9b1f77d9ee31 (diff) | |
download | puppet-nginx-68890c0f2bf8387b1d2fe9d0eef46f39f593d404.tar.gz puppet-nginx-68890c0f2bf8387b1d2fe9d0eef46f39f593d404.tar.bz2 |
Caching support
-rw-r--r-- | manifests/base.pp | 7 | ||||
-rw-r--r-- | templates/nginx.conf.erb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 3caaeaa..a118980 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -10,11 +10,16 @@ class nginx::base { group => "root", } + # Caching + file { [ '/var/cache', '/var/cache/nginx' ]: + ensure => directory, + } + service { "nginx": enable => true, ensure => running, hasrestart => true, - require => Package["nginx"], + require => [ Package["nginx"], File['/var/cache/nginx'] ], } define site($ensure = present, $source = 'file') { diff --git a/templates/nginx.conf.erb b/templates/nginx.conf.erb index cf339dd..f4c24f0 100644 --- a/templates/nginx.conf.erb +++ b/templates/nginx.conf.erb @@ -29,6 +29,9 @@ http { gzip off; #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; + # caching + proxy_cache_path /var/cache/nginx/ levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g; + include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; |