diff --git a/manifests/config.pp b/manifests/config.pp index 9d14867ab..61ff05c37 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -68,6 +68,7 @@ $http_tcp_nodelay = 'on', $http_tcp_nopush = 'off', $keepalive_timeout = '65', + $keepalive_requests = '100', $log_format = {}, $mail = false, $stream = false, diff --git a/manifests/init.pp b/manifests/init.pp index ab8aa624a..2656b62de 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,6 +43,7 @@ $http_tcp_nodelay = undef, $http_tcp_nopush = undef, $keepalive_timeout = undef, + $keepalive_requests = undef, $mail = undef, $multi_accept = undef, $names_hash_bucket_size = undef, @@ -164,6 +165,7 @@ $http_tcp_nodelay or $http_tcp_nopush or $keepalive_timeout or + $keepalive_requests or $logdir or $log_format or $mail or @@ -247,6 +249,7 @@ http_tcp_nodelay => $http_tcp_nodelay, http_tcp_nopush => $http_tcp_nopush, keepalive_timeout => $keepalive_timeout, + keepalive_requests => $keepalive_requests, log_dir => $logdir, log_format => $log_format, mail => $mail, diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index 1fbaa189b..92dee1671 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -263,6 +263,12 @@ value: '123', match: ' keepalive_timeout 123;' }, + { + title: 'should set keepalive_requests', + attr: 'keepalive_requests', + value: '345', + match: ' keepalive_requests 345;' + }, { title: 'should set tcp_nodelay', attr: 'http_tcp_nodelay', @@ -458,6 +464,12 @@ value: '123', match: ' keepalive_timeout 123;' }, + { + title: 'should set keepalive_requests', + attr: 'keepalive_requests', + value: '345', + match: ' keepalive_requests 345;' + }, { title: 'should set mail', attr: 'mail', diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index 9b8368d0d..ff4b2a8ce 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -62,6 +62,7 @@ http { server_names_hash_max_size <%= @names_hash_max_size %>; keepalive_timeout <%= @keepalive_timeout %>; + keepalive_requests <%= @keepalive_requests %>; tcp_nodelay <%= @http_tcp_nodelay %>; <% if @gzip == 'on' -%>