module-nginx/templates/vhost/vhost_location_directory.erb

66 lines
2.2 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.sort_by {|k,v| k}.each do |key,value| -%>
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
<% 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 -%>
<% 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 -%>
<% end -%>
<% end -%><% end -%>
<% if defined? @www_root -%>
2013-07-17 20:42:57 +02:00
root <%= @www_root %>;
<% end -%>
<% if @try_files -%>
try_files<% @try_files.each do |try| -%> <%= try %><% end -%>;
<% end -%>
<% if defined? @autoindex -%>
autoindex <%= @autoindex %>;
<% end -%>
<% if @index_files.count > 0 -%>
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
<% end -%>
<% @rewrite_rules.each do |rewrite_rule| -%>
rewrite <%= rewrite_rule %>;
<% end -%>
<% if defined? @auth_basic -%>
2013-07-17 20:42:57 +02:00
auth_basic "<%= @auth_basic %>";
<% end -%>
<% if defined? @auth_basic_user_file -%>
2013-07-17 20:42:57 +02:00
auth_basic_user_file <%= @auth_basic_user_file %>;
<% 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(subvalue).each do |asubvalue| -%>
2014-03-11 16:09:59 +01:00
<%= key %> <%= subkey %> <%= asubvalue %>;
2014-03-10 10:26:35 +01:00
<% end -%>
<% 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 -%>
<% end -%>
<% 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| -%>
<%= 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| -%>
<%= key %> <%= asubvalue %>
2014-03-10 10:38:16 +01:00
<% end -%>
<% end -%>
<% end -%><% end -%>
}