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

Support for proxy_pass_header directive. #922

Merged
merged 1 commit into from
Oct 12, 2016

Conversation

gallagherrchris
Copy link

It is better to explicitly define this than using raw_append or raw_prepend.

From nginx docs:
Permits passing otherwise disabled header fields from a proxied server to a client.
By default, nginx does not pass the header fields "Date", "Server", "X-Pad", and "X-Accel-..." from the response of a proxied server to a client.

@wyardley
Copy link
Collaborator

wyardley commented Oct 11, 2016

I've done it with $location_cfg_append (or equivalent for vhost) and it worked OK, but this looks great to me, especially since it's in vhost and location contexts.

@@ -688,6 +688,15 @@
]
},
{
title: 'should pass proxy headers',
attr: 'proxy_pass_header',
value: ['X-testHeader1 value1', 'X-TestHeader2 value2'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think maybe the case mismatch here is why the test is failing (testHeader vs. TestHeader)?

Copy link
Author

Choose a reason for hiding this comment

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

Ah nice catch. I will update that

@@ -24,6 +24,11 @@
proxy_hide_header <%= header %>;
<%- end -%>
<% end -%>
<% unless @proxy_pass_header.nil? -%>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This matches $proxy_hide_header, but since we're already later validating that it's an array, I wonder if it would be simpler and more readable to define both as undef in 104-105, and then just use if @proxy_XXX?

Otherwise, I think maybe @proxy_pass_header.empty? might be preferable, though would defer to someone with more Ruby knowledge on that.

It is better to explicitly define this than using raw_append or raw_prepend.

From nginx docs:
Permits passing otherwise disabled header fields from a proxied server to a client.
By default, nginx does not pass the header fields "Date", "Server", "X-Pad", and "X-Accel-..." from the response of a proxied server to a client.
@wyardley
Copy link
Collaborator

This looks reasonable to me... the conditionals already are inconsistent, so don't think the style thing is a dealbreaker.

cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Sep 13, 2019
Support for proxy_pass_header directive.
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
Support for proxy_pass_header directive.
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.

None yet

2 participants