Allow specification of locations to not be proxied

A user of httpd::vhost::proxy may wish to exclude certain URLs from
being proxied.  This change allows the template to be populated with
such exclusions.

Change-Id: I55a86d3c703a667daf55cb75cf559eb23a556219
This commit is contained in:
Clint Adams 2015-10-01 13:20:31 -04:00
parent d3261cdc81
commit c39fde20ed
2 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,8 @@ define httpd::vhost::proxy (
$servername = undef,
$serveraliases = undef,
$ssl = false,
$vhost_name = '*'
$vhost_name = '*',
$proxyexclusions = undef,
) {
include ::httpd

View File

@ -16,6 +16,12 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
Order deny,allow
Allow from all
</Proxy>
<% if @proxyexclusions.is_a? Array %>
<% @proxyexclusions.each do |name| %><%= " ProxyPass #{name} !\n" %><% end %>
<% elsif @proxyexclusions != nil %>
<%= " ProxyPass #{@proxyexclusions} !" %>
<% end %>
ProxyPass / <%= @dest %>/
ProxyPassReverse / <%= @dest %>/
ProxyPreserveHost On