module-nginx/templates/vhost/vhost_ssl_footer.erb

34 lines
1.2 KiB
Text
Raw Normal View History

2013-07-21 17:20:07 +02:00
<% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>;
<% end -%><% end -%>
<% if @vhost_cfg_append -%><% @vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.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-02-08 00:37:32 +01:00
<% if @vhost_cfg_ssl_append -%><% @vhost_cfg_ssl_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
2014-03-09 20:46:13 +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 -%>
<% 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 -%>
2013-07-21 17:20:07 +02:00
}
<% if @rewrite_www_to_non_www -%>
server {
listen <%= @listen_ip %>:<%= @ssl_port %> ssl;
server_name www.<%= @server_name[0].gsub(/^www\./, '') %>;
return 301 https://<%= @server_name[0].gsub(/^www\./, '') %>$uri;
2013-07-21 17:20:07 +02:00
}
<% end %>