Skip to content

Commit

Permalink
Merge pull request #910 from mkobel/master
Browse files Browse the repository at this point in the history
Add params to proxy_pass in vhost
  • Loading branch information
igalic committed Oct 28, 2014
2 parents bc56a5e + 332c66c commit 6fc7455
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1135,14 +1135,15 @@ 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'] },
],
}
```

`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`

Expand Down
3 changes: 2 additions & 1 deletion templates/vhost/_proxy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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? -%> <%= proxy['params'] %> <%- end -%>

<Location <%= proxy['path']%>>
<%- if proxy['reverse_urls'].nil? -%>
ProxyPassReverse <%= proxy['url'] %>
Expand Down

0 comments on commit 6fc7455

Please sign in to comment.