-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Conversation
I've done it with |
@@ -688,6 +688,15 @@ | |||
] | |||
}, | |||
{ | |||
title: 'should pass proxy headers', | |||
attr: 'proxy_pass_header', | |||
value: ['X-testHeader1 value1', 'X-TestHeader2 value2'], |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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? -%> |
There was a problem hiding this comment.
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.
2f7ea6a
to
95d651c
Compare
This looks reasonable to me... the conditionals already are inconsistent, so don't think the style thing is a dealbreaker. |
Support for proxy_pass_header directive.
Support for proxy_pass_header directive.
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.