diff --git a/manifests/config.pp b/manifests/config.pp index fdaef59..0cd95d3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -41,6 +41,7 @@ class nginx::config( $conf_template = $nginx::params::nx_conf_template, $proxy_conf_template = $nginx::params::nx_proxy_conf_template, $proxy_redirect = $nginx::params::nx_proxy_redirect, + $fastcgi_cache_path = $nginx::params::nx_fastcgi_cache_path, ) inherits nginx::params { File { diff --git a/manifests/init.pp b/manifests/init.pp index 3d67aa2..53bf3c7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -66,6 +66,7 @@ class nginx ( $nginx_locations = {}, $nginx_mailhosts = {}, $manage_repo = $nginx::params::manage_repo, + $fastcgi_cache_path = $nginx::params::nx_fastcgi_cache_path, ) inherits nginx::params { include stdlib @@ -118,6 +119,9 @@ class nginx ( validate_hash($nginx_locations) validate_hash($nginx_mailhosts) validate_bool($manage_repo) + if ($fastcgi_cache_path != false) { + validate_string($fastcgi_cache_path) + } class { 'nginx::package': package_name => $package_name, @@ -155,6 +159,7 @@ class nginx ( proxy_redirect => $proxy_redirect, require => Class['nginx::package'], notify => Class['nginx::service'], + fastcgi_cache_path => $fastcgi_cache_path, } class { 'nginx::service': diff --git a/manifests/params.pp b/manifests/params.pp index 8ecf101..8e9661f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -53,6 +53,8 @@ class nginx::params { $nx_proxy_cache_max_size = '500m' $nx_proxy_cache_inactive = '20m' + $nx_fastcgi_cache_path = false + $nx_client_body_temp_path = "${nx_run_dir}/client_body_temp" $nx_client_body_buffer_size = '128k' $nx_client_max_body_size = '10m' diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index 62e49e2..ebaa723 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -39,6 +39,10 @@ http { proxy_cache_path <%= @proxy_cache_path %> levels=<%= @proxy_cache_levels %> keys_zone=<%= @proxy_cache_keys_zone %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %>; <% end -%> +<% if @fastcgi_cache_path -%> + fastcgi_cache_path <%= @fastcgi_cache_path %>; +<% end -%> + <% if @http_cfg_append -%><% @http_cfg_append.sort_by{|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%>