2013-07-17 20:42:57 +02:00
|
|
|
location <%= @location %> {
|
2013-09-04 19:04:28 +02:00
|
|
|
<% if @location_allow -%><% @location_allow.each do |allow_rule| -%>
|
2014-03-12 17:18:05 +01:00
|
|
|
allow <%= allow_rule %>;
|
2013-09-04 19:04:28 +02:00
|
|
|
<% end -%><% end -%>
|
|
|
|
<% if @location_deny -%><% @location_deny.each do |deny_rule| -%>
|
2014-03-12 17:18:05 +01:00
|
|
|
deny <%= deny_rule %>;
|
2013-09-04 19:04:28 +02:00
|
|
|
<% end -%><% end -%>
|
2014-03-08 02:16:07 +01:00
|
|
|
<% if @location_custom_cfg_prepend -%><% @location_custom_cfg_prepend.each do |value| -%>
|
2014-03-08 02:32:40 +01:00
|
|
|
<%= value %>
|
2014-01-12 20:15:14 +01:00
|
|
|
<% end -%><% end -%>
|
2013-08-15 21:05:38 +02:00
|
|
|
<% if @location_cfg_prepend -%><% @location_cfg_prepend.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(subvalue).each do |asubvalue| -%>
|
2014-04-13 11:26:25 +02:00
|
|
|
<%= key %> <%= subkey %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%><% else -%>
|
2014-03-11 16:09:59 +01:00
|
|
|
<% Array(value).each do |asubvalue| -%>
|
2014-04-13 11:26:25 +02:00
|
|
|
<%= key %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%>
|
2012-10-03 01:35:52 +02:00
|
|
|
<% end -%><% end -%>
|
2013-07-31 23:07:59 +02:00
|
|
|
<% if defined? @www_root -%>
|
2013-07-17 20:42:57 +02:00
|
|
|
root <%= @www_root %>;
|
2013-07-31 23:07:59 +02:00
|
|
|
<% end -%>
|
2013-05-20 16:30:32 +02:00
|
|
|
<% if @try_files -%>
|
2013-11-22 05:04:39 +01:00
|
|
|
try_files<% @try_files.each do |try| -%> <%= try %><% end -%>;
|
2013-05-20 16:30:32 +02:00
|
|
|
<% end -%>
|
2014-02-10 18:14:18 +01:00
|
|
|
<% if defined? @autoindex -%>
|
|
|
|
autoindex <%= @autoindex %>;
|
2013-12-16 17:36:24 +01:00
|
|
|
<% end -%>
|
2013-12-25 01:13:22 +01:00
|
|
|
<% if @index_files.count > 0 -%>
|
2014-01-06 07:44:54 +01:00
|
|
|
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
|
2013-05-20 16:30:32 +02:00
|
|
|
<% 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-11-22 05:22:01 +01:00
|
|
|
<% if defined? @auth_basic -%>
|
2013-07-17 20:42:57 +02:00
|
|
|
auth_basic "<%= @auth_basic %>";
|
2013-05-20 16:30:32 +02:00
|
|
|
<% end -%>
|
2013-11-22 05:22:01 +01:00
|
|
|
<% if defined? @auth_basic_user_file -%>
|
2013-07-17 20:42:57 +02:00
|
|
|
auth_basic_user_file <%= @auth_basic_user_file %>;
|
2013-05-20 16:30:32 +02:00
|
|
|
<% end -%>
|
2013-08-15 21:05:38 +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(subvalue).each do |asubvalue| -%>
|
2014-03-11 16:09:59 +01:00
|
|
|
<%= key %> <%= subkey %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%><% else -%>
|
2014-03-11 16:09:59 +01:00
|
|
|
<% Array(value).each do |asubvalue| -%>
|
|
|
|
<%= key %> <%= asubvalue %>;
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|
2014-03-05 13:22:50 +01:00
|
|
|
<% end -%>
|
2014-01-12 20:15:14 +01:00
|
|
|
<% end -%><% end -%>
|
2014-03-10 10:38:16 +01:00
|
|
|
<% if @location_custom_cfg_append -%><% @location_custom_cfg_append.each do |key,value| -%>
|
|
|
|
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
|
|
|
|
<% Array(subvalue).each do |asubvalue| -%>
|
2014-04-12 21:17:45 +02:00
|
|
|
<%= key %> <%= subkey %> <%= asubvalue %>
|
2014-03-10 10:38:16 +01:00
|
|
|
<% end -%>
|
|
|
|
<% end -%><% else -%>
|
2014-03-11 16:09:59 +01:00
|
|
|
<% Array(value).each do |asubvalue| -%>
|
2014-04-12 21:17:45 +02:00
|
|
|
<%= key %> <%= asubvalue %>
|
2014-03-10 10:38:16 +01:00
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
2012-10-03 01:35:52 +02:00
|
|
|
<% end -%><% end -%>
|
2013-05-20 16:30:32 +02:00
|
|
|
}
|