Browse Source

Allow specification of DocumentRoot when reverse-proxying partially

If any locations are being excluded from reverse-proxying, we need
to be able to specify a DocumentRoot to serve up un-proxied files.

Change-Id: I1c5fe6f73b5983886578975e89c5e4148b506795
master
Clint Adams 3 years ago
parent
commit
a827227079
2 changed files with 4 additions and 0 deletions
  1. 1
    0
      manifests/vhost/proxy.pp
  2. 3
    0
      templates/vhost-proxy.conf.erb

+ 1
- 0
manifests/vhost/proxy.pp View File

@@ -28,6 +28,7 @@ define httpd::vhost::proxy (
28 28
     $ssl           = false,
29 29
     $vhost_name    = '*',
30 30
     $proxyexclusions = undef,
31
+    $docroot       = undef,
31 32
   ) {
32 33
 
33 34
   include ::httpd

+ 3
- 0
templates/vhost-proxy.conf.erb View File

@@ -26,6 +26,9 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
26 26
    ProxyPassReverse / <%= @dest %>/
27 27
    ProxyPreserveHost On 
28 28
 
29
+<% if @proxyexclusions != nil and @docroot != nil %>
30
+   DocumentRoot <%= @docroot %>
31
+<% end %>
29 32
    ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
30 33
    LogLevel warn
31 34
    CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined

Loading…
Cancel
Save