diff --git a/manifests/config.pp b/manifests/config.pp index b816abddb..45c1f86d1 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -71,7 +71,7 @@ $proxy_cache_path = false, $proxy_connect_timeout = '90', $proxy_headers_hash_bucket_size = '64', - $proxy_http_version = '1.0', + $proxy_http_version = undef, $proxy_read_timeout = '90', $proxy_redirect = 'off', $proxy_send_timeout = '90', @@ -107,7 +107,9 @@ } validate_string($multi_accept) validate_array($proxy_set_header) - validate_string($proxy_http_version) + if ($proxy_http_version != undef) { + validate_string($proxy_http_version) + } validate_bool($confd_purge) validate_bool($vhost_purge) if ($proxy_cache_path != false) { diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index 2f53eba2c..ba50afa98 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -231,6 +231,12 @@ :value => '1.1', :match => 'proxy_http_version 1.1;', }, + { + :title => 'should not set proxy_http_version', + :attr => 'proxy_http_version', + :value => nil, + :notmatch => 'proxy_http_version', + }, { :title => 'should contain ordered appended directives', :attr => 'proxy_set_header', diff --git a/templates/conf.d/proxy.conf.erb b/templates/conf.d/proxy.conf.erb index bea96fba4..d0801328f 100644 --- a/templates/conf.d/proxy.conf.erb +++ b/templates/conf.d/proxy.conf.erb @@ -8,7 +8,8 @@ proxy_send_timeout <%= @proxy_send_timeout %>; proxy_read_timeout <%= @proxy_read_timeout %>; proxy_buffers <%= @proxy_buffers %>; proxy_buffer_size <%= @proxy_buffer_size %>; -proxy_http_version <%= @proxy_http_version %>; +<% if @proxy_http_version -%> +proxy_http_version <%= @proxy_http_version %>;<% end %> <% @proxy_set_header.each do |header| %> proxy_set_header <%= header %>;<% end %> proxy_headers_hash_bucket_size <%= @proxy_headers_hash_bucket_size %>;