Browse Source

Merge pull request #50 from oxilion/proxy_http_version

Proxy http version
James Fryman 11 years ago
parent
commit
34e41b75a9

+ 1 - 0
manifests/config.pp

@@ -17,6 +17,7 @@ class nginx::config(
   $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 {

+ 6 - 4
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:
 #
@@ -32,6 +32,7 @@ class nginx (
   $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,
@@ -49,15 +50,16 @@ class nginx (
     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

+ 1 - 0
manifests/params.pp

@@ -46,6 +46,7 @@ class nginx::params {
   $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',

+ 1 - 0
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 %>

+ 4 - 2
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 -%>
   }