From fda2969c208079fdc69975bc25938d0f523cc948 Mon Sep 17 00:00:00 2001 From: Omar Tamer Date: Wed, 4 Sep 2013 17:37:18 +0100 Subject: [PATCH 1/3] make client_max_body_size configurable --- manifests/config.pp | 1 + manifests/init.pp | 2 ++ templates/conf.d/proxy.conf.erb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 000afbeba..24836d0fb 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -27,6 +27,7 @@ $proxy_http_version = $nginx::params::nx_proxy_http_version, $types_hash_max_size = $nginx::params::nx_types_hash_max_size, $types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size, + $client_max_body_size = $nginx::params::nx_client_max_body_size, $http_cfg_append = $nginx::params::nx_http_cfg_append ) inherits nginx::params { File { diff --git a/manifests/init.pp b/manifests/init.pp index 49651fda2..73079e616 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,6 +43,7 @@ $service_restart = $nginx::params::nx_service_restart, $mail = $nginx::params::nx_mail, $server_tokens = $nginx::params::nx_server_tokens, + $client_max_body_size = $nginx::params::nx_client_max_body_size, $http_cfg_append = $nginx::params::nx_http_cfg_append, $nginx_vhosts = {}, $nginx_upstreams = {}, @@ -67,6 +68,7 @@ proxy_cache_inactive => $proxy_cache_inactive, confd_purge => $confd_purge, server_tokens => $server_tokens, + client_max_body_size => $client_max_body_size, http_cfg_append => $http_cfg_append, require => Class['nginx::package'], notify => Class['nginx::service'], diff --git a/templates/conf.d/proxy.conf.erb b/templates/conf.d/proxy.conf.erb index 8225879c5..b1d96656f 100644 --- a/templates/conf.d/proxy.conf.erb +++ b/templates/conf.d/proxy.conf.erb @@ -1,5 +1,5 @@ proxy_redirect <%= scope.lookupvar('nginx::params::nx_proxy_redirect') %>; -client_max_body_size <%= scope.lookupvar('nginx::params::nx_client_max_body_size') %>; +client_max_body_size <%= @client_max_body_size %>; client_body_buffer_size <%= scope.lookupvar('nginx::params::nx_client_body_buffer_size') %>; proxy_connect_timeout <%= scope.lookupvar('nginx::params::nx_proxy_connect_timeout') %>; proxy_send_timeout <%= scope.lookupvar('nginx::params::nx_proxy_send_timeout') %>; From 53b4986b5d142c6461acb7e4eb307ed4a82822a3 Mon Sep 17 00:00:00 2001 From: Omar Z Date: Thu, 5 Sep 2013 22:57:50 +0100 Subject: [PATCH 2/3] make proxy_buffers configurable --- manifests/config.pp | 1 + manifests/init.pp | 2 ++ templates/conf.d/proxy.conf.erb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 24836d0fb..4bcce9050 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -28,6 +28,7 @@ $types_hash_max_size = $nginx::params::nx_types_hash_max_size, $types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size, $client_max_body_size = $nginx::params::nx_client_max_body_size, + $proxy_buffers = $nginx::params::nx_proxy_buffers, $http_cfg_append = $nginx::params::nx_http_cfg_append ) inherits nginx::params { File { diff --git a/manifests/init.pp b/manifests/init.pp index febff7656..41dc122de 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -45,6 +45,7 @@ $mail = $nginx::params::nx_mail, $server_tokens = $nginx::params::nx_server_tokens, $client_max_body_size = $nginx::params::nx_client_max_body_size, + $proxy_buffers = $nginx::params::nx_proxy_buffers, $http_cfg_append = $nginx::params::nx_http_cfg_append, $nginx_vhosts = {}, $nginx_upstreams = {}, @@ -70,6 +71,7 @@ confd_purge => $confd_purge, server_tokens => $server_tokens, client_max_body_size => $client_max_body_size, + proxy_buffers => $proxy_buffers, http_cfg_append => $http_cfg_append, require => Class['nginx::package'], notify => Class['nginx::service'], diff --git a/templates/conf.d/proxy.conf.erb b/templates/conf.d/proxy.conf.erb index b1d96656f..af114ad5d 100644 --- a/templates/conf.d/proxy.conf.erb +++ b/templates/conf.d/proxy.conf.erb @@ -4,7 +4,7 @@ client_body_buffer_size <%= scope.lookupvar('nginx::params::nx_client_body_buffe proxy_connect_timeout <%= scope.lookupvar('nginx::params::nx_proxy_connect_timeout') %>; proxy_send_timeout <%= scope.lookupvar('nginx::params::nx_proxy_send_timeout') %>; proxy_read_timeout <%= scope.lookupvar('nginx::params::nx_proxy_read_timeout') %>; -proxy_buffers <%= scope.lookupvar('nginx::params::nx_proxy_buffers') %>; +proxy_buffers <%= @proxy_buffers %>; proxy_http_version <%= @proxy_http_version %>; <% @proxy_set_header.each do |header| %> proxy_set_header <%= header %>;<% end %> From 4da3e462076dff6fd151e37817090ca11031f324 Mon Sep 17 00:00:00 2001 From: Omar Z Date: Thu, 5 Sep 2013 23:15:45 +0100 Subject: [PATCH 3/3] added proxy_buffer_size with default value of 8k --- manifests/config.pp | 3 ++- manifests/init.pp | 2 ++ manifests/params.pp | 1 + templates/conf.d/proxy.conf.erb | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 4bcce9050..230a663ce 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -29,7 +29,8 @@ $types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size, $client_max_body_size = $nginx::params::nx_client_max_body_size, $proxy_buffers = $nginx::params::nx_proxy_buffers, - $http_cfg_append = $nginx::params::nx_http_cfg_append + $http_cfg_append = $nginx::params::nx_http_cfg_append, + $proxy_buffer_size = $nginx::params::nx_proxy_buffer_size, ) inherits nginx::params { File { owner => 'root', diff --git a/manifests/init.pp b/manifests/init.pp index 41dc122de..63d93f8c1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -46,6 +46,7 @@ $server_tokens = $nginx::params::nx_server_tokens, $client_max_body_size = $nginx::params::nx_client_max_body_size, $proxy_buffers = $nginx::params::nx_proxy_buffers, + $proxy_buffer_size = $nginx::params::nx_proxy_buffer_size, $http_cfg_append = $nginx::params::nx_http_cfg_append, $nginx_vhosts = {}, $nginx_upstreams = {}, @@ -72,6 +73,7 @@ server_tokens => $server_tokens, client_max_body_size => $client_max_body_size, proxy_buffers => $proxy_buffers, + proxy_buffer_size => $proxy_buffer_size, http_cfg_append => $http_cfg_append, require => Class['nginx::package'], notify => Class['nginx::service'], diff --git a/manifests/params.pp b/manifests/params.pp index 2b19b3b71..a38abdbb9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,6 +58,7 @@ $nx_proxy_read_timeout = '90' $nx_proxy_buffers = '32 4k' $nx_proxy_http_version = '1.0' + $nx_proxy_buffer_size = '8k' $nx_logdir = $::kernel ? { /(?i-mx:linux)/ => '/var/log/nginx', diff --git a/templates/conf.d/proxy.conf.erb b/templates/conf.d/proxy.conf.erb index af114ad5d..fcd7e1d5b 100644 --- a/templates/conf.d/proxy.conf.erb +++ b/templates/conf.d/proxy.conf.erb @@ -5,6 +5,7 @@ proxy_connect_timeout <%= scope.lookupvar('nginx::params::nx_proxy_connect_tim proxy_send_timeout <%= scope.lookupvar('nginx::params::nx_proxy_send_timeout') %>; proxy_read_timeout <%= scope.lookupvar('nginx::params::nx_proxy_read_timeout') %>; proxy_buffers <%= @proxy_buffers %>; +proxy_buffer_size <%= @proxy_buffer_size %>; proxy_http_version <%= @proxy_http_version %>; <% @proxy_set_header.each do |header| %> proxy_set_header <%= header %>;<% end %>