diff --git a/templates/vhost/vhost_footer.erb b/templates/vhost/vhost_footer.erb index 72b85b1f4..43141f52c 100644 --- a/templates/vhost/vhost_footer.erb +++ b/templates/vhost/vhost_footer.erb @@ -1,14 +1,14 @@ -<% if @include_files %><% @include_files.each do |file| -%> +<% if @include_files %><% @include_files.each_line do |file| -%> include <%= file %>; <% end -%><% end -%> -<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%> +<% if @vhost_cfg_append -%><% vhost_cfg_append.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%> <% end -%> } <% if @rewrite_www_to_non_www -%> server { - listen <%= @listen_ip %>; + listen <%= @listen_ip %>:<%= @listen_port %>; server_name www.<%= @name.gsub(/^www\./, '') %>; rewrite ^ http://<%= @name.gsub(/^www\./, '') %>$uri permanent; } diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index e4d966f61..35cc6b65d 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -11,7 +11,7 @@ server { <% if defined? auth_basic_user_file -%> auth_basic_user_file <%= @auth_basic_user_file %>; <% end -%> -<% @proxy_set_header.each do |header| -%> +<% @proxy_set_header.each_line do |header| -%> proxy_set_header <%= header %>; <% end -%> <% if @rewrite_to_https -%> diff --git a/templates/vhost/vhost_location_directory.erb b/templates/vhost/vhost_location_directory.erb index 61705d345..73af430bd 100644 --- a/templates/vhost/vhost_location_directory.erb +++ b/templates/vhost/vhost_location_directory.erb @@ -6,10 +6,10 @@ root <%= @www_root %>; <% end -%> <% if @try_files -%> - try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>; + try_files <% @try_files.each_line do |try| -%> <%= try %> <% end -%>; <% end -%> <% if @index_files -%> - index <% @index_files.each do |i| %> <%= i %><% end %>; + index <% @index_files.each_line do |i| %> <%= i %><% end %>; <% end -%> <% if defined? auth_basic -%> auth_basic "<%= @auth_basic %>"; diff --git a/templates/vhost/vhost_location_fastcgi.erb b/templates/vhost/vhost_location_fastcgi.erb index 1306729a8..73c6c4598 100644 --- a/templates/vhost/vhost_location_fastcgi.erb +++ b/templates/vhost/vhost_location_fastcgi.erb @@ -9,7 +9,7 @@ fastcgi_split_path_info <%= @fastcgi_split_path %>; <% end -%> <% if @try_files -%> - try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>; + try_files <% @try_files.each_line do |try| -%> <%= try %> <% end -%>; <% end -%> include <%= @fastcgi_params %>; fastcgi_pass <%= @fastcgi %>;