module-nginx/templates/vhost/locations/proxy.erb
Josh Samuelson 12dfb7e98d Support for proxy_hide_header directive.
I need this to hide X-Frame-Options for a single location block.

From nginx docs:
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. The proxy_hide_header directive sets additional fields that will
not be passed.
2016-05-12 09:09:16 -07:00

34 líneas
1,1 KiB
Text

proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
proxy_connect_timeout <%= @proxy_connect_timeout %>;
proxy_redirect <%= @proxy_redirect %>;
<% if @proxy_method -%>
proxy_method <%= @proxy_method %>;
<% end -%>
<% if @proxy_set_body -%>
proxy_set_body <%= @proxy_set_body %>;
<% end -%>
<% unless @proxy_set_header.nil? -%>
<%- @proxy_set_header.each do |header| -%>
proxy_set_header <%= header %>;
<%- end -%>
<% end -%>
<% unless @proxy_hide_header.nil? -%>
<%- @proxy_hide_header.each do |header| -%>
proxy_hide_header <%= header %>;
<%- end -%>
<% end -%>
<% if @proxy_cache -%>
proxy_cache <%= @proxy_cache %>;
<% end -%>
<% if @proxy_cache_valid && Array(@proxy_cache_valid).size > 0 -%>
<%- Array(@proxy_cache_valid).each do |line| -%>
proxy_cache_valid <%= line %>;
<%- end -%>
<% end -%>
<% if @proxy_cache_use_stale -%>
proxy_cache_use_stale <%= @proxy_cache_use_stale %>;
<% end -%>
<% if @proxy_cache_key -%>
proxy_cache_key <%= @proxy_cache_key %>;
<% end -%>