Skip to content

Commit

Permalink
Support keywords along with proxy_pass, use hash for params
Browse files Browse the repository at this point in the history
  • Loading branch information
mark0n authored and Morgan Haskel committed Nov 7, 2014
1 parent f27d4f8 commit 63ed0d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,9 @@ apache::vhost { 'site.name.fdqn':
{ 'path' => '/l', 'url' => 'http://backend-xy',
'reverse_urls' => ['http://backend-x', 'http://backend-y'] },
{ 'path' => '/d', 'url' => 'http://backend-a/d',
'params' => ['retry=0', 'timeout=5'] },
'params' => { 'retry' => '0', 'timeout' => '5' }, },
{ 'path' => '/e', 'url' => 'http://backend-a/e',
'keywords' => ['nocanon', 'interpolate'] },
],
}
```
Expand Down
8 changes: 7 additions & 1 deletion templates/vhost/_proxy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
ProxyPreserveHost On
<%- end -%>
<%- [@proxy_pass].flatten.compact.each do |proxy| -%>
ProxyPass <%= proxy['path'] %> <%= proxy['url'] %> <%- if !proxy['params'].nil? -%> <%= proxy['params'] %> <%- end -%>
ProxyPass <%= proxy['path'] %> <%= proxy['url'] -%>
<%- if proxy['params'] -%>
<%- proxy['params'].each_pair do |key, value| -%> <%= key %>=<%= value -%>
<%- end -%>
<%- end -%>
<%- if proxy['keywords'] %> <%= proxy['keywords'].join(' ') -%>
<%- end %>
<Location <%= proxy['path']%>>
<%- if proxy['reverse_urls'].nil? -%>
ProxyPassReverse <%= proxy['url'] %>
Expand Down

0 comments on commit 63ed0d3

Please sign in to comment.