From c39fde20ed5cb616654d90863165fe91b5d04845 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 1 Oct 2015 13:20:31 -0400 Subject: [PATCH] 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 --- manifests/vhost/proxy.pp | 3 ++- templates/vhost-proxy.conf.erb | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/vhost/proxy.pp b/manifests/vhost/proxy.pp index 72d091d..86d5622 100644 --- a/manifests/vhost/proxy.pp +++ b/manifests/vhost/proxy.pp @@ -26,7 +26,8 @@ define httpd::vhost::proxy ( $servername = undef, $serveraliases = undef, $ssl = false, - $vhost_name = '*' + $vhost_name = '*', + $proxyexclusions = undef, ) { include ::httpd diff --git a/templates/vhost-proxy.conf.erb b/templates/vhost-proxy.conf.erb index 05c6a8a..f275775 100644 --- a/templates/vhost-proxy.conf.erb +++ b/templates/vhost-proxy.conf.erb @@ -16,6 +16,12 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %> Order deny,allow Allow from all + +<% 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