Skip to content

Commit

Permalink
added documentation and test for ProxyPreserveHost option
Browse files Browse the repository at this point in the history
  • Loading branch information
Conzar committed May 1, 2014
1 parent 8481e7d commit 16e8c50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,10 @@ Specifies the verbosity of the error log. Defaults to 'warn' for the global serv

Specifies URLs you do not want to proxy. This parameter is meant to be used in combination with [`proxy_dest`](#proxy_dest).

#####`proxy_preserve_host`

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).

#####`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 @@ -478,6 +478,7 @@
# proxy fragment:
# - $proxy_dest
# - $no_proxy_uris
# - $proxy_preserve_host (true to set ProxyPreserveHost to on and false to off
# rack fragment:
# - $rack_base_uris
# redirect fragment:
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 @@ -102,6 +102,7 @@ class { 'apache': }
proxy_pass => [
{ 'path' => '/foo', 'url' => 'http://backend-foo/'},
],
proxy_preserve_host => true,
}
EOS
apply_manifest(pp, :catch_failures => true)
Expand All @@ -111,6 +112,7 @@ class { 'apache': }
it { should contain '<VirtualHost \*:80>' }
it { should contain "ServerName proxy.example.com" }
it { should contain "ProxyPass" }
it { should contain "ProxyPreserveHost On" }
it { should_not contain "<Proxy \*>" }
end
end
Expand Down
8 changes: 7 additions & 1 deletion spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,17 @@
:match => [/^ WSGIApplicationGroup %{GLOBAL}$/],
},
{
:title => 'should accept a wsgi pass authorization',
:title => 'should set wsgi pass authorization',
:attr => 'wsgi_pass_authorization',
:value => 'On',
:match => [/^ WSGIPassAuthorization On$/],
},
{
:title => 'should set wsgi pass authorization false',
:attr => 'wsgi_pass_authorization',
:value => 'Off',
:match => [/^ WSGIPassAuthorization Off$/],
},
{
:title => 'should contain environment variables',
:attr => 'access_log_env_var',
Expand Down

0 comments on commit 16e8c50

Please sign in to comment.