Skip to content

Commit

Permalink
add ProxyErrorOverride directive
Browse files Browse the repository at this point in the history
add tests for proxy_error_override
  • Loading branch information
timogoebel committed Feb 16, 2015
1 parent dfcbecd commit 55b3d8b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,10 @@ Specifies URLs you do not want to proxy. This parameter is meant to be used in c

Sets the [ProxyPreserveHost Directive](http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypreservehost). true Enables the Host: line from an incoming request to be proxied to the host instead of hostname . false sets this option to off (default).

#####`proxy_error_override`

Sets the [ProxyErrorOverride Directive](http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyerroroverride). This directive controls whether apache should override error pages for proxied content. This option is off by default.

#####`options`

Sets the [Options](http://httpd.apache.org/docs/current/mod/core.html#options) for the specified virtual host. Defaults to '['Indexes','FollowSymLinks','MultiViews']', as demonstrated below:
Expand Down
1 change: 1 addition & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
$php_admin_values = {},
$no_proxy_uris = [],
$proxy_preserve_host = false,
$proxy_error_override = false,
$redirect_source = '/',
$redirect_dest = undef,
$redirect_status = undef,
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class { 'apache': }
{ 'path' => '/foo', 'url' => 'http://backend-foo/'},
],
proxy_preserve_host => true,
proxy_error_override => true,
}
EOS
apply_manifest(pp, :catch_failures => true)
Expand All @@ -113,6 +114,7 @@ class { 'apache': }
it { is_expected.to contain "ServerName proxy.example.com" }
it { is_expected.to contain "ProxyPass" }
it { is_expected.to contain "ProxyPreserveHost On" }
it { is_expected.to contain "ProxyErrorOverride On" }
it { is_expected.not_to contain "<Proxy \*>" }
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
'php_admin_values' => ['true', 'false'],
'no_proxy_uris' => '/foo',
'proxy_preserve_host' => true,
'proxy_error_override' => true,
'redirect_source' => '/bar',
'redirect_dest' => '/',
'redirect_status' => 'temp',
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/_proxy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<% if @proxy_preserve_host -%>
ProxyPreserveHost On
<%- end -%>
<% if @proxy_error_override -%>
ProxyErrorOverride On
<%- end -%>
<%- [@proxy_pass].flatten.compact.each do |proxy| -%>
ProxyPass <%= proxy['path'] %> <%= proxy['url'] -%>
<%- if proxy['params'] -%>
Expand Down

0 comments on commit 55b3d8b

Please sign in to comment.