From 8859c4e8dbcd744209efbbf605f681354e482509 Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Mon, 6 May 2013 11:37:37 +0200 Subject: [PATCH 1/3] linting --- manifests/init.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 85c5bd89c..03fb3cd35 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,8 +4,8 @@ # # Parameters: # -# There are no default parameters for this class. All module parameters are managed -# via the nginx::params class +# There are no default parameters for this class. All module parameters are +# managed via the nginx::params class # # Actions: # @@ -49,15 +49,16 @@ worker_processes => $worker_processes, worker_connections => $worker_connections, proxy_set_header => $proxy_set_header, + proxy_http_version => $proxy_http_version, confd_purge => $confd_purge, server_tokens => $server_tokens, require => Class['nginx::package'], notify => Class['nginx::service'], } - class { 'nginx::service': + class { 'nginx::service': configtest_enable => $configtest_enable, - service_restart => $service_restart, + service_restart => $service_restart, } # Allow the end user to establish relationships to the "main" class From 3630b74c72655f92b7b7fe35544acfe084f6a527 Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Mon, 6 May 2013 11:38:34 +0200 Subject: [PATCH 2/3] return the newline between cfg lines --- templates/vhost/vhost_location_proxy.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_proxy.erb b/templates/vhost/vhost_location_proxy.erb index ac54f9f53..c0b27d6ae 100644 --- a/templates/vhost/vhost_location_proxy.erb +++ b/templates/vhost/vhost_location_proxy.erb @@ -1,8 +1,10 @@ location <%= location %> { <% if @location_cfg_prepend -%><% location_cfg_prepend.each do |key,value| -%> - <%= key %> <%= value %>;<% end -%><% end -%> + <%= key %> <%= value %>; +<% end -%><% end -%> proxy_pass <%= proxy %>; proxy_read_timeout <%= proxy_read_timeout %>; <% if @location_cfg_append -%><% location_cfg_append.each do |key,value| -%> - <%= key %> <%= value %>;<% end -%><% end -%> + <%= key %> <%= value %>; +<% end -%><% end -%> } From 57ee1ec1e70013817cc108a73e0174b743f778e8 Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Mon, 6 May 2013 11:40:46 +0200 Subject: [PATCH 3/3] make proxy_http_version configurable --- manifests/config.pp | 1 + manifests/init.pp | 1 + manifests/params.pp | 1 + templates/conf.d/proxy.conf.erb | 1 + 4 files changed, 4 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index ef688d1b5..958799de9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -17,6 +17,7 @@ $worker_processes = $nginx::params::nx_worker_processes, $worker_connections = $nginx::params::nx_worker_connections, $proxy_set_header = $nginx::params::nx_proxy_set_header, + $proxy_http_version = $nginx::params::nx_proxy_http_version, $confd_purge = $nginx::params::nx_confd_purge, $server_tokens = $nginx::params::nx_server_tokens ) inherits nginx::params { diff --git a/manifests/init.pp b/manifests/init.pp index 03fb3cd35..e56b803e1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -32,6 +32,7 @@ $worker_processes = $nginx::params::nx_worker_processes, $worker_connections = $nginx::params::nx_worker_connections, $proxy_set_header = $nginx::params::nx_proxy_set_header, + $proxy_http_version = $nginx::params::nx_proxy_http_version, $confd_purge = $nginx::params::nx_confd_purge, $configtest_enable = $nginx::params::nx_configtest_enable, $service_restart = $nginx::params::nx_service_restart, diff --git a/manifests/params.pp b/manifests/params.pp index b07284743..d1b62386e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -46,6 +46,7 @@ $nx_proxy_send_timeout = '90' $nx_proxy_read_timeout = '90' $nx_proxy_buffers = '32 4k' + $nx_proxy_http_version = '1.0' $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 82546bf35..9c1238a6d 100644 --- a/templates/conf.d/proxy.conf.erb +++ b/templates/conf.d/proxy.conf.erb @@ -5,5 +5,6 @@ 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 <%= scope.lookupvar('nginx::params::nx_proxy_buffers') %>; +proxy_http_version <%= @proxy_http_version %>; <% proxy_set_header.each do |header| %> proxy_set_header <%= header %>;<% end %>