2013-07-17 20:42:57 +02:00
|
|
|
location <%= @location %> {
|
2014-02-07 13:30:50 +01:00
|
|
|
<% 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 -%>
|
2014-03-08 02:16:07 +01:00
|
|
|
<% 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| -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
|
2014-03-07 15:20:58 +01:00
|
|
|
<% Array(subkey).each do |asubkey| -%>
|
|
|
|
<% Array(subvalue).each do |asubvalue| -%>
|
|
|
|
<%= key %> <%= asubkey %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%><% else -%>
|
2014-03-07 13:53:32 +01:00
|
|
|
<% Array(value).each do |sub| -%>
|
|
|
|
<%= key %> <%= sub %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%>
|
2014-02-17 20:51:14 +01:00
|
|
|
<% end -%><% end -%>
|
2013-07-17 20:42:57 +02:00
|
|
|
<% if @proxy_cache -%>
|
|
|
|
proxy_cache <%= @proxy_cache %>;
|
|
|
|
proxy_cache_valid <%= @proxy_cache_valid %>;
|
2013-03-27 19:13:52 +01:00
|
|
|
<% end -%>
|
2013-07-17 20:42:57 +02:00
|
|
|
proxy_pass <%= @proxy %>;
|
|
|
|
proxy_read_timeout <%= @proxy_read_timeout %>;
|
2013-11-27 19:56:04 +01:00
|
|
|
<% if @proxy_method -%>
|
2013-10-15 22:49:33 +02:00
|
|
|
proxy_method <%= @proxy_method %>;
|
|
|
|
<% end -%>
|
2013-11-27 19:56:04 +01:00
|
|
|
<% if @proxy_set_body -%>
|
2013-10-16 00:01:50 +02:00
|
|
|
proxy_set_body <%= @proxy_set_body %>;
|
|
|
|
<% end -%>
|
2014-01-13 19:20:02 +01:00
|
|
|
<% @rewrite_rules.each do |rewrite_rule| -%>
|
2014-01-02 19:13:59 +01:00
|
|
|
rewrite <%= rewrite_rule %>;
|
2014-01-13 19:20:02 +01:00
|
|
|
<% 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| -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
|
2014-03-07 15:20:58 +01:00
|
|
|
<% Array(subkey).each do |asubkey| -%>
|
|
|
|
<% Array(subvalue).each do |asubvalue| -%>
|
|
|
|
<%= key %> <%= asubkey %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%><% else -%>
|
2014-03-07 13:53:32 +01:00
|
|
|
<% 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 -%>
|
2014-03-08 02:16:07 +01:00
|
|
|
<% end -%><% end -%>
|
|
|
|
<% if @location_custom_cfg_append -%><% @location_custom_cfg_append.each do |value| -%>
|
|
|
|
<%= value %>;
|
2014-02-17 20:51:14 +01:00
|
|
|
<% end -%><% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
|
2011-06-07 00:25:04 +02:00
|
|
|
}
|
2013-07-31 23:07:59 +02:00
|
|
|
|