77 lines
2.4 KiB
Text
77 lines
2.4 KiB
Text
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 |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 %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% else -%>
|
|
<% Array(value).each do |sub| -%>
|
|
<%= key %> <%= sub %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% 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 %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% else -%>
|
|
<% Array(value).each do |sub| -%>
|
|
<%= key %> <%= sub %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% end -%>
|
|
<% if @proxy_cache -%>
|
|
proxy_cache <%= @proxy_cache %>;
|
|
proxy_cache_valid <%= @proxy_cache_valid %>;
|
|
<% end -%>
|
|
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 -%>
|
|
<% 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 %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% else -%>
|
|
<% Array(value).each do |sub| -%>
|
|
<%= key %> <%= sub %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% end -%>
|
|
<% if @location_custom_cfg_append -%><% @location_custom_cfg_append.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 %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% else -%>
|
|
<% Array(value).each do |sub| -%>
|
|
<%= key %> <%= sub %>;
|
|
<% end -%>
|
|
<% end -%>
|
|
<% end -%><% end -%>
|
|
|
|
}
|
|
|