diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index e60173e004..99c950f041 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -188,6 +188,20 @@ 'provider' => 'location', 'auth_ldap_referrals' => 'off', }, + { + 'path' => '/proxy', + 'provider' => 'location', + 'proxy_pass' => [ + { + 'url' => 'http://backend-b/', + 'keywords' => ['noquery', 'interpolate'], + 'params' => { + 'retry' => '0', + 'timeout' => '5', + }, + }, + ], + }, { 'path' => '/var/www/node-app/public', 'passenger_enabled' => true, @@ -611,6 +625,11 @@ content: %r{^\s+LDAPReferrals off$}, ) } + it { + is_expected.to contain_concat__fragment('rspec.example.com-directories').with( + content: %r{^\s+ProxyPass http://backend-b/ retry=0 timeout=5 noquery interpolate$}, + ) + } it { is_expected.to contain_concat__fragment('rspec.example.com-directories').with( content: %r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$}, diff --git a/templates/vhost/_directories.erb b/templates/vhost/_directories.erb index 0025d29cd1..bb95ac14ef 100644 --- a/templates/vhost/_directories.erb +++ b/templates/vhost/_directories.erb @@ -460,7 +460,7 @@ <%- end -%> <%- if directory['proxy_pass'] and directory['provider'] and directory['provider'].match('location') -%> <%- directory['proxy_pass'].flatten.compact.each do |proxy| -%> - ProxyPass <%= proxy['url'] %> + ProxyPass <%= proxy['url'] -%> <%- if proxy['params'] -%> <%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%> <%- end -%>