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

Add support for proxy method and body #170

Merged

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Oct 28, 2013

Add support for setting proxy method and proxy body.
We found this useful when using nginx to rewrite our requests.
Usage example:

nginx::resource::vhost { $host:
    ensure   => present,
    proxy  => $destination,
    proxy_method => 'POST',
    proxy_set_body => 'hello world'
}

I wasn't sure if and where to add method-specific tests for this ;)

(fyi: The comment in manifests/resource/location.pp looks a bit out of place, but it's because the others aren't aligned correctly. I'll add a separate MR after this to fix them.)

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
@arlimus
Copy link
Contributor Author

arlimus commented Nov 27, 2013

Rebased on latest master, since Travis is working again.

@@ -8,6 +8,12 @@
<% end -%>
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
<% if not @proxy_method.nil? -%>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just use if @proxy_method (same for @proxy_set_body)

kudos to Matthew Haughton for this suggestion

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
@arlimus
Copy link
Contributor Author

arlimus commented Nov 27, 2013

@3flex Thank you! I updated the PR

@3flex
Copy link
Contributor

3flex commented Nov 27, 2013

Could you also try adding tests for this new functionality? Have a look in spec/defines

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
@arlimus
Copy link
Contributor Author

arlimus commented Nov 28, 2013

@3flex I added specs for both items, thanks again!

@jfryman
Copy link
Contributor

jfryman commented Dec 5, 2013

Awesome! Thanks for this!

jfryman pushed a commit that referenced this pull request Dec 5, 2013
…d_body

Add support for proxy method and body
@jfryman jfryman merged commit 7c16742 into voxpupuli:master Dec 5, 2013
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Oct 23, 2017
…method_and_body

Add support for proxy method and body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants