Skip to content

Commit

Permalink
default proxy_redirect to undef in locations (resolves voxpupuli#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
William Yardley committed Oct 27, 2016
1 parent 03812a3 commit 36a1a0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
$proxy_headers_hash_bucket_size = '64',
$proxy_http_version = undef,
$proxy_read_timeout = '90',
$proxy_redirect = 'off',
$proxy_redirect = undef,
$proxy_send_timeout = '90',
$proxy_set_header = [
'Host $host',
Expand Down
12 changes: 12 additions & 0 deletions spec/defines/resource_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,18 @@

describe 'vhost_location_proxy template content' do
[
{
title: 'should set proxy_redirect',
attr: 'proxy_redirect',
value: 'value',
match: %r{^\s+proxy_redirect\s+value;}
},
{
title: 'should not set proxy_redirect',
attr: 'proxy_redirect',
value: :undef,
notmatch: %r{proxy_redirect\b}
},
{
title: 'should set proxy_cache',
attr: 'proxy_cache',
Expand Down
2 changes: 2 additions & 0 deletions templates/vhost/locations/proxy.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
proxy_connect_timeout <%= @proxy_connect_timeout %>;
<% if @proxy_redirect -%>
proxy_redirect <%= @proxy_redirect %>;
<% end -%>
<% if @proxy_http_version -%>
proxy_http_version <%= @proxy_http_version %>;
<% end -%>
Expand Down

0 comments on commit 36a1a0d

Please sign in to comment.