summaryrefslogtreecommitdiff
path: root/manifests/cache.pp
blob: 7045abc09253bd62eb3419ee0976c11ec8062705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class nginx::cache(
  $ensure = 'present',
) {
  file { '/var/cache/nginx':
    ensure  => directory,
    owner   => 'www-data',
    group   => 'www-data',
    mode    => '0700',
    require => Service['nginx'],
  }

  file { '/etc/nginx/conf.d/cache.conf' :
    ensure  => $ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => "proxy_cache_path /var/cache/nginx/ levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;\n",
    require => File['/var/cache/nginx'],
    notify  => Service['nginx'],
  }
}