module-nginx/templates/vhost/vhost_location_proxy.erb

58 lines
1.8 KiB
Text
Raw Normal View History

2013-07-17 20:42:57 +02:00
location <%= @location %> {
<% if @location_allow -%><% @location_allow.each do |allow_rule| -%>
allow <%= allow_rule %>;
<% end -%><% end -%>
<% if @location_deny -%><% @location_deny.each do |deny_rule| -%>
deny <%= deny_rule %>;
<% end -%><% end -%>
<% if @location_custom_cfg_prepend -%><% @location_custom_cfg_prepend.each do |value| -%>
<%= value %>;
<% end -%><% end -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.each do |key,value| -%>
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
<% Array(subkey).each do |asubkey| -%>
<% Array(subvalue).each do |asubvalue| -%>
<%= key %> <%= asubkey %> <%= asubvalue %>;
2014-03-10 10:26:35 +01:00
<% end -%>
<% end -%>
<% end -%><% else -%>
<% Array(value).each do |sub| -%>
<%= key %> <%= sub %>;
2014-03-10 10:26:35 +01:00
<% end -%>
<% end -%>
<% end -%><% end -%>
2013-07-17 20:42:57 +02:00
<% if @proxy_cache -%>
proxy_cache <%= @proxy_cache %>;
proxy_cache_valid <%= @proxy_cache_valid %>;
<% end -%>
2013-07-17 20:42:57 +02:00
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
<% if @proxy_method -%>
proxy_method <%= @proxy_method %>;
<% end -%>
<% if @proxy_set_body -%>
proxy_set_body <%= @proxy_set_body %>;
<% end -%>
<% @rewrite_rules.each do |rewrite_rule| -%>
rewrite <%= rewrite_rule %>;
<% end -%>
2013-07-17 20:42:57 +02:00
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
<% Array(subkey).each do |asubkey| -%>
<% Array(subvalue).each do |asubvalue| -%>
<%= key %> <%= asubkey %> <%= asubvalue %>;
2014-03-10 10:26:35 +01:00
<% end -%>
<% end -%>
<% end -%><% else -%>
<% Array(value).each do |sub| -%>
<%= key %> <%= sub %>;
2014-03-10 10:26:35 +01:00
<% end -%>
2014-03-09 20:46:13 +01:00
<% end -%>
<% end -%><% end -%>
<% if @location_custom_cfg_append -%><% @location_custom_cfg_append.each do |value| -%>
<%= value %>;
<% end -%><% end -%>
2011-06-07 00:25:04 +02:00
}