From 7432862fe811124e08ffb3b75b8a4ec97daa1018 Mon Sep 17 00:00:00 2001 From: Christian Kaenzig Date: Tue, 16 Dec 2014 16:48:35 +0100 Subject: [PATCH] Allow disabling proxy_http_version directive The EPEL 6 repository still has version 1.0.15 which does not support this directive proxy_http_version. Yes, this version is old, but a lot of people prefer not to use a bleeding edge version from nginx.org. --- manifests/config.pp | 4 +++- templates/conf.d/proxy.conf.erb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 88b9b07dc..88c9eaf41 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -106,7 +106,9 @@ } validate_string($multi_accept) validate_array($proxy_set_header) - validate_string($proxy_http_version) + if ($proxy_http_version != false) { + validate_string($proxy_http_version) + } validate_bool($confd_purge) validate_bool($vhost_purge) if ($proxy_cache_path != false) { 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 %>;