From 304d66c3ae98066faa9aadfe762aa32eb993d628 Mon Sep 17 00:00:00 2001 From: Moritz Kobel Date: Wed, 22 Oct 2014 16:43:25 +0200 Subject: [PATCH] Add params to proxy_pass to provide ProxyPass key=value connection settings --- README.md | 3 ++- templates/vhost/_proxy.erb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28c541d44..1418696bf 100644 --- a/README.md +++ b/README.md @@ -1135,7 +1135,7 @@ apache::vhost { 'site.name.fdqn': proxy_pass => [ { 'path' => '/a', 'url' => 'http://backend-a/' }, { 'path' => '/b', 'url' => 'http://backend-b/' }, - { 'path' => '/c', 'url' => 'http://backend-a/c' }, + { 'path' => '/c', 'url' => 'http://backend-a/c', 'params' => 'max=20 ttl=120 retry=300' }, { 'path' => '/l', 'url' => 'http://backend-xy', 'reverse_urls' => ['http://backend-x', 'http://backend-y'] }, ], @@ -1143,6 +1143,7 @@ apache::vhost { 'site.name.fdqn': ``` `reverse_urls` is optional and can be an array or a string. It is useful when used with `mod_proxy_balancer`. +`params` is an optional parameter. It allows to provide the ProxyPass key=value parameters (Connection settings). #####`rack_base_uris` diff --git a/templates/vhost/_proxy.erb b/templates/vhost/_proxy.erb index 045c90691..0f21af2ec 100644 --- a/templates/vhost/_proxy.erb +++ b/templates/vhost/_proxy.erb @@ -7,7 +7,8 @@ ProxyPreserveHost On <%- end -%> <%- [@proxy_pass].flatten.compact.each do |proxy| -%> - ProxyPass <%= proxy['path'] %> <%= proxy['url'] %> + ProxyPass <%= proxy['path'] %> <%= proxy['url'] %> <%- if proxy['params'].nil? == false -%> <%= proxy['params'] %> <%- end -%> + > <%- if proxy['reverse_urls'].nil? -%> ProxyPassReverse <%= proxy['url'] %>