add additional fastcgi parameters
This commit is contained in:
parent
024cc33d62
commit
659a8cd4d0
4 changed files with 122 additions and 98 deletions
|
@ -26,6 +26,11 @@ class nginx::config(
|
|||
$proxy_cache_keys_zone = $nginx::params::nx_proxy_cache_keys_zone,
|
||||
$proxy_cache_max_size = $nginx::params::nx_proxy_cache_max_size,
|
||||
$proxy_cache_inactive = $nginx::params::nx_proxy_cache_inactive,
|
||||
$fastcgi_cache_path = $nginx::params::nx_fastcgi_cache_path,
|
||||
$fastcgi_cache_levels = $nginx::params::nx_fastcgi_cache_levels,
|
||||
$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,
|
||||
$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,
|
||||
|
@ -41,7 +46,6 @@ 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 {
|
||||
|
|
|
@ -44,6 +44,11 @@ class nginx (
|
|||
$proxy_cache_keys_zone = $nginx::params::nx_proxy_cache_keys_zone,
|
||||
$proxy_cache_max_size = $nginx::params::nx_proxy_cache_max_size,
|
||||
$proxy_cache_inactive = $nginx::params::nx_proxy_cache_inactive,
|
||||
$fastcgi_cache_path = $nginx::params::nx_fastcgi_cache_path,
|
||||
$fastcgi_cache_levels = $nginx::params::nx_fastcgi_cache_levels,
|
||||
$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,
|
||||
$configtest_enable = $nginx::params::nx_configtest_enable,
|
||||
$service_restart = $nginx::params::nx_service_restart,
|
||||
$service_ensure = $nginx::params::nx_service_ensure,
|
||||
|
@ -66,7 +71,6 @@ 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
|
||||
|
@ -96,6 +100,17 @@ class nginx (
|
|||
validate_string($proxy_cache_keys_zone)
|
||||
validate_string($proxy_cache_max_size)
|
||||
validate_string($proxy_cache_inactive)
|
||||
|
||||
if ($fastcgi_cache_path != false) {
|
||||
validate_string($fastcgi_cache_path)
|
||||
}
|
||||
if (!is_integer($fastcgi_cache_levels)) {
|
||||
fail('$fastcgi_cache_levels must be an integer.')
|
||||
}
|
||||
validate_string($fastcgi_cache_keys_zone)
|
||||
validate_string($fastcgi_cache_max_size)
|
||||
validate_string($fastcgi_cache_inactive)
|
||||
|
||||
validate_bool($configtest_enable)
|
||||
validate_string($service_restart)
|
||||
validate_bool($mail)
|
||||
|
@ -119,9 +134,6 @@ 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,
|
||||
|
@ -142,6 +154,11 @@ class nginx (
|
|||
proxy_cache_keys_zone => $proxy_cache_keys_zone,
|
||||
proxy_cache_max_size => $proxy_cache_max_size,
|
||||
proxy_cache_inactive => $proxy_cache_inactive,
|
||||
fastcgi_cache_path => $fastcgi_cache_path,
|
||||
fastcgi_cache_levels => $fastcgi_cache_levels,
|
||||
fastcgi_cache_keys_zone => $fastcgi_cache_keys_zone,
|
||||
fastcgi_cache_max_size => $fastcgi_cache_max_size,
|
||||
fastcgi_cache_inactive => $fastcgi_cache_inactive,
|
||||
confd_purge => $confd_purge,
|
||||
vhost_purge => $vhost_purge,
|
||||
server_tokens => $server_tokens,
|
||||
|
@ -159,7 +176,6 @@ class nginx (
|
|||
proxy_redirect => $proxy_redirect,
|
||||
require => Class['nginx::package'],
|
||||
notify => Class['nginx::service'],
|
||||
fastcgi_cache_path => $fastcgi_cache_path,
|
||||
}
|
||||
|
||||
class { 'nginx::service':
|
||||
|
|
|
@ -54,6 +54,10 @@ class nginx::params {
|
|||
$nx_proxy_cache_inactive = '20m'
|
||||
|
||||
$nx_fastcgi_cache_path = false
|
||||
$nx_fastcgi_cache_levels = 1
|
||||
$nx_fastcgi_cache_keys_zone = 'd3:100m'
|
||||
$nx_fastcgi_cache_max_size = '500m'
|
||||
$nx_fastcgi_cache_inactive = '20m'
|
||||
|
||||
$nx_client_body_temp_path = "${nx_run_dir}/client_body_temp"
|
||||
$nx_client_body_buffer_size = '128k'
|
||||
|
|
|
@ -40,7 +40,7 @@ http {
|
|||
<% end -%>
|
||||
|
||||
<% if @fastcgi_cache_path -%>
|
||||
fastcgi_cache_path <%= @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 %>;
|
||||
<% end -%>
|
||||
|
||||
<% if @http_cfg_append -%><% @http_cfg_append.sort_by{|k,v| k}.each do |key,value| -%>
|
||||
|
|
Loading…
Reference in a new issue