Add fastcgi_cache_key and fastcgi_cache_use_stale parameters

This commit is contained in:
root 2014-04-27 09:49:45 -04:00
parent 659a8cd4d0
commit 402febc599
4 changed files with 21 additions and 1 deletions

View file

@ -31,6 +31,8 @@ class nginx::config(
$fastcgi_cache_keys_zone = $nginx::params::nx_fastcgi_cache_keys_zone,
$fastcgi_cache_max_size = $nginx::params::nx_fastcgi_cache_max_size,
$fastcgi_cache_inactive = $nginx::params::nx_fastcgi_cache_inactive,
$fastcgi_cache_key = $nginx::params::nx_fastcgi_cache_key,
$fastcgi_cache_use_stale = $nginx::params::nx_fastcgi_cache_use_stale,
$proxy_http_version = $nginx::params::nx_proxy_http_version,
$names_hash_bucket_size = $nginx::params::nx_names_hash_bucket_size,
$names_hash_max_size = $nginx::params::nx_names_hash_max_size,

View file

@ -49,6 +49,8 @@ class nginx (
$fastcgi_cache_keys_zone = $nginx::params::nx_fastcgi_cache_keys_zone,
$fastcgi_cache_max_size = $nginx::params::nx_fastcgi_cache_max_size,
$fastcgi_cache_inactive = $nginx::params::nx_fastcgi_cache_inactive,
$fastcgi_cache_key = $nginx::params::nx_fastcgi_cache_key,
$fastcgi_cache_use_stale = $nginx::params::nx_fastcgi_cache_use_stale,
$configtest_enable = $nginx::params::nx_configtest_enable,
$service_restart = $nginx::params::nx_service_restart,
$service_ensure = $nginx::params::nx_service_ensure,
@ -110,6 +112,12 @@ class nginx (
validate_string($fastcgi_cache_keys_zone)
validate_string($fastcgi_cache_max_size)
validate_string($fastcgi_cache_inactive)
if ($fastcgi_cache_key != false) {
validate_string($fastcgi_cache_key)
}
if ($fastcgi_cache_use_stale != false) {
validate_string($fastcgi_cache_use_stale)
}
validate_bool($configtest_enable)
validate_string($service_restart)
@ -159,6 +167,8 @@ class nginx (
fastcgi_cache_keys_zone => $fastcgi_cache_keys_zone,
fastcgi_cache_max_size => $fastcgi_cache_max_size,
fastcgi_cache_inactive => $fastcgi_cache_inactive,
fastcgi_cache_key => $fastcgi_cache_key,
fastcgi_cache_use_stale => $fastcgi_cache_use_stale,
confd_purge => $confd_purge,
vhost_purge => $vhost_purge,
server_tokens => $server_tokens,

View file

@ -58,6 +58,8 @@ class nginx::params {
$nx_fastcgi_cache_keys_zone = 'd3:100m'
$nx_fastcgi_cache_max_size = '500m'
$nx_fastcgi_cache_inactive = '20m'
$nx_fastcgi_cache_key = false
$nx_fastcgi_cache_use_stale = false
$nx_client_body_temp_path = "${nx_run_dir}/client_body_temp"
$nx_client_body_buffer_size = '128k'

View file

@ -40,7 +40,13 @@ http {
<% end -%>
<% if @fastcgi_cache_path -%>
fastcgi_cache_path <%= @fastcgi_cache_path %> levels=<%= @fastcgi_cache_levels %> keys_zone=<%= @fastcgi_cache_keys_zone %> max_size=<%= @fastcgi_cache_max_size %> inactive=<%= @fastcgi_cache_inactive %>;
fastcgi_cache_path <%= @fastcgi_cache_path %> levels=<%= @fastcgi_cache_levels %> keys_zone=<%= @fastcgi_cache_keys_zone %> max_size=<%= @fastcgi_cache_max_size %> inactive=<%= @fastcgi_cache_inactive %>;
<% end -%>
<% if @fastcgi_cache_key -%>
fastcgi_cache_key <%= @fastcgi_cache_key %>;
<% end -%>
<% if @fastcgi_cache_use_stale -%>
fastcgi_cache_use_stale <%= @fastcgi_cache_use_stale %>;
<% end -%>
<% if @http_cfg_append -%><% @http_cfg_append.sort_by{|k,v| k}.each do |key,value| -%>