2013-08-23 10:58:43 +02:00
|
|
|
<% if @include_files %><% @include_files.each do |file| -%>
|
2013-05-13 10:57:58 +02:00
|
|
|
include <%= file %>;
|
|
|
|
<% end -%><% end -%>
|
2013-08-17 01:29:05 +02:00
|
|
|
<%# make sure that allow comes before deny by forcing the allow key (if it -%>
|
|
|
|
<%# exists) to be first in the output order. The hash keys also need to be -%>
|
|
|
|
<%# sorted so that the ordering is stable. -%>
|
2013-09-13 16:29:50 +02:00
|
|
|
<% if @vhost_cfg_append -%><% @vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
|
2014-03-08 02:16:07 +01:00
|
|
|
<% 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 -%>
|
2014-03-08 02:16:07 +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-08 02:16:07 +01:00
|
|
|
<% end -%>
|
2014-03-07 13:53:32 +01:00
|
|
|
<% end -%><% end -%>
|
2011-06-07 00:25:04 +02:00
|
|
|
}
|
2013-07-17 20:42:57 +02:00
|
|
|
<% if @rewrite_www_to_non_www -%>
|
2012-09-01 17:52:55 +02:00
|
|
|
server {
|
2014-06-23 17:28:52 +02:00
|
|
|
listen <%= @listen_ip %>:<%= @listen_port %>;
|
|
|
|
server_name www.<%= @name.gsub(/^www\./, '') %>;
|
|
|
|
return 301 http://<%= @name.gsub(/^www\./, '') %>$uri;
|
2012-09-01 17:52:55 +02:00
|
|
|
}
|
2014-03-10 10:26:35 +01:00
|
|
|
<% end -%>
|