Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set multiple ProxyPassReverse directives #793

Conversation

roidelapluie
Copy link
Contributor

Useful when used with proxy balancers

ProxyPassReverse <%= proxy['url'] %>
<% else %>
<% proxy['reverse_urls'].each do |rurl| %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be wrapped in an array like Array(proxy['reverse_urls']).each do |rurl| so it doesn't crash if a single reverse URL is passed.

@underscorgan
Copy link
Contributor

This requires README updates and test coverage.

@roidelapluie
Copy link
Contributor Author

@mhaskel Done :-)

<% Array(proxy['reverse_urls']).each do |reverse_url| %>
ProxyPassReverse <%= reverse_url %>
<% end %>
<% end %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be -%>

@roidelapluie
Copy link
Contributor Author

@mhaskel changes done

@underscorgan
Copy link
Contributor

@roidelapluie I'm seeing test failures when I run the unit tests locally:

rspec ./spec/defines/vhost_spec.rb:701 # apache::vhost os-independent items .conf content when proxy_pass is {"path"=>"/path-a", "url"=>"http://fake.com/a"} should accept proxy_pass hash: matches
rspec ./spec/defines/vhost_spec.rb:701 # apache::vhost os-independent items .conf content when proxy_pass is {"path"=>"/path-a", "url"=>"http://fake.com/a", "reverse_urls"=>"http://127.0.0.1:8080"} should
 accept reverse_urls string: matches
rspec ./spec/defines/vhost_spec.rb:701 # apache::vhost os-independent items .conf content when proxy_pass is {"path"=>"/path-a", "url"=>"http://fake.com/a", "reverse_urls"=>["http://127.0.0.1:8080", "http
://127.0.0.1:8081"]} should accept reverse_urls array: matches
rspec ./spec/defines/vhost_spec.rb:701 # apache::vhost os-independent items .conf content when proxy_pass is [{"path"=>"/path-a/", "url"=>"http://fake.com/a/"}, {"path"=>"/path-b", "url"=>"http://fake.com
/b"}] should accept proxy_pass array of hash: matches

Also, we fixed the travis-ci issues that were in master, so if you rebase it will be easier to see that the tests were fixed :)

@roidelapluie
Copy link
Contributor Author

@mhaskel this is fixed and rebased now

@igalic
Copy link
Contributor

igalic commented Aug 6, 2014

@roidelapluie please also squash your commits down to one. (It's nice for git-bisect if every commit passes tests)

This commit allows you to add an array or a string as a proxy_pass['reverse_url']
parameter.

Useful when used with mod_balancer.
@roidelapluie
Copy link
Contributor Author

@igalic done

underscorgan pushed a commit that referenced this pull request Aug 7, 2014
…PassReverse_directives

Allow to set multiple ProxyPassReverse directives
@underscorgan underscorgan merged commit b2b0022 into puppetlabs:master Aug 7, 2014
@underscorgan
Copy link
Contributor

@roidelapluie thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants