2014-11-12 06:04:45 +01:00
|
|
|
|
2014-06-23 23:26:20 +02:00
|
|
|
location <%= @location %> {
|
2014-06-23 22:31:32 +02:00
|
|
|
<% if @internal -%>
|
|
|
|
internal;
|
|
|
|
<% end -%>
|
2014-08-19 03:07:22 +02:00
|
|
|
<% if @mp4 -%>
|
|
|
|
mp4;
|
|
|
|
<% end -%>
|
|
|
|
<% if @flv -%>
|
|
|
|
flv;
|
|
|
|
<% end -%>
|
2014-06-23 23:26:20 +02: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 -%>
|
|
|
|
<% if @location_custom_cfg_prepend -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- @location_custom_cfg_prepend.each do |key,value| -%>
|
|
|
|
<%- if value.is_a?(Hash) -%>
|
|
|
|
<%- value.each do |subkey,subvalue| -%>
|
|
|
|
<%- Array(subvalue).each do |asubvalue| -%>
|
2014-06-23 23:26:20 +02:00
|
|
|
<%= key %> <%= subkey %> <%= asubvalue %>
|
|
|
|
<%- end -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- end -%>
|
|
|
|
<%- else -%>
|
|
|
|
<%- Array(value).each do |asubvalue| -%>
|
|
|
|
<%= key %> <%= asubvalue %>
|
|
|
|
<%- end -%>
|
2014-06-23 23:26:20 +02:00
|
|
|
<%- end -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- end -%>
|
2014-06-23 23:26:20 +02:00
|
|
|
<% end -%>
|
|
|
|
<% if @location_cfg_prepend -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- @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-06-23 23:26:20 +02:00
|
|
|
<%= key %> <%= subkey %> <%= asubvalue %>;
|
|
|
|
<%- end -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- end -%>
|
|
|
|
<%- else -%>
|
|
|
|
<%- Array(value).each do |asubvalue| -%>
|
|
|
|
<%= key %> <%= asubvalue %>;
|
|
|
|
<%- end -%>
|
2014-06-23 23:26:20 +02:00
|
|
|
<%- end -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- end -%>
|
2014-06-23 23:26:20 +02:00
|
|
|
<% end -%>
|
2014-09-12 19:42:51 +02:00
|
|
|
<% if @raw_prepend && Array(@raw_prepend).size > 0 -%>
|
2014-06-26 05:40:22 +02:00
|
|
|
<%- Array(@raw_prepend).each do |line| -%>
|
|
|
|
<%= line %>
|
|
|
|
<%- end -%>
|
2014-11-12 06:04:45 +01:00
|
|
|
<% end -%>
|