From 1f007e3587f99d0e4b649e83cc70ac9bcdd1ca71 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 17:04:36 +0200 Subject: [PATCH 01/15] add listen_port on rewrite_www_to_non_www Adding the port in case it is not by default. --- templates/vhost/vhost_footer.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vhost/vhost_footer.erb b/templates/vhost/vhost_footer.erb index 72b85b1f4..904c2e8b6 100644 --- a/templates/vhost/vhost_footer.erb +++ b/templates/vhost/vhost_footer.erb @@ -8,7 +8,7 @@ include <%= file %>; } <% 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; } From 90c5b7349e815834c8281a8cb5d415c6c1867f56 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:50:20 +0200 Subject: [PATCH 02/15] Update vhost_footer.erb --- templates/vhost/vhost_footer.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_footer.erb b/templates/vhost/vhost_footer.erb index 904c2e8b6..43141f52c 100644 --- a/templates/vhost/vhost_footer.erb +++ b/templates/vhost/vhost_footer.erb @@ -1,7 +1,7 @@ -<% 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 -%> From b432d5269ce031eb60d3977117c2bfc659868a22 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:52:35 +0200 Subject: [PATCH 03/15] Update vhost_header.erb --- templates/vhost/vhost_header.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -%> From 939d0bd458ccb863d8b5845c73c07f09377c72a1 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:53:45 +0200 Subject: [PATCH 04/15] Update vhost_location_alias.erb --- templates/vhost/vhost_location_alias.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_alias.erb b/templates/vhost/vhost_location_alias.erb index e2ddbdd28..ef36d9f2b 100644 --- a/templates/vhost/vhost_location_alias.erb +++ b/templates/vhost/vhost_location_alias.erb @@ -1,8 +1,8 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> alias <%= @location_alias %>; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> } From d10eaa423afaa47b125deaa84f21b6469b2b1c8b Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:54:41 +0200 Subject: [PATCH 05/15] Update vhost_location_directory.erb --- templates/vhost/vhost_location_directory.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/vhost/vhost_location_directory.erb b/templates/vhost/vhost_location_directory.erb index 61705d345..883e7a224 100644 --- a/templates/vhost/vhost_location_directory.erb +++ b/templates/vhost/vhost_location_directory.erb @@ -1,15 +1,15 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if defined? @www_root -%> 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 %>"; @@ -17,7 +17,7 @@ <% if defined? auth_basic_user_file -%> 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 @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From f87d4770dfc3708126dd0b4801b8a84f09436958 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:55:14 +0200 Subject: [PATCH 06/15] Update vhost_location_empty.erb --- templates/vhost/vhost_location_empty.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vhost/vhost_location_empty.erb b/templates/vhost/vhost_location_empty.erb index aea023cb6..bdec9fd3f 100644 --- a/templates/vhost/vhost_location_empty.erb +++ b/templates/vhost/vhost_location_empty.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From 0be9924df5a95d79424c0ac81be4e54285a6bc75 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:56:05 +0200 Subject: [PATCH 07/15] Update vhost_location_fastcgi.erb --- templates/vhost/vhost_location_fastcgi.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/vhost/vhost_location_fastcgi.erb b/templates/vhost/vhost_location_fastcgi.erb index 1306729a8..520bc1dda 100644 --- a/templates/vhost/vhost_location_fastcgi.erb +++ b/templates/vhost/vhost_location_fastcgi.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if defined? @www_root -%> @@ -9,14 +9,14 @@ 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 %>; <% if defined? @fastcgi_script %> fastcgi_param SCRIPT_FILENAME <%= @fastcgi_script %>; <% end -%> -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From be5dd67875a6670444e1025b34020d25f89bd895 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:56:58 +0200 Subject: [PATCH 08/15] Update vhost_location_proxy.erb --- templates/vhost/vhost_location_proxy.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_proxy.erb b/templates/vhost/vhost_location_proxy.erb index 33fe51495..dab034c60 100644 --- a/templates/vhost/vhost_location_proxy.erb +++ b/templates/vhost/vhost_location_proxy.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if @proxy_cache -%> @@ -8,7 +8,7 @@ <% end -%> proxy_pass <%= @proxy %>; proxy_read_timeout <%= @proxy_read_timeout %>; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From 029e40b83634beca086dc6fec3e87734faa595a9 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 18:57:22 +0200 Subject: [PATCH 09/15] Update vhost_location_stub_status.erb --- templates/vhost/vhost_location_stub_status.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_stub_status.erb b/templates/vhost/vhost_location_stub_status.erb index 0827324a9..36cc294ab 100644 --- a/templates/vhost/vhost_location_stub_status.erb +++ b/templates/vhost/vhost_location_stub_status.erb @@ -1,8 +1,8 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> stub_status on; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> } From 3a2dd716a061020424171f8726c5249004394b32 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:05:02 +0200 Subject: [PATCH 10/15] Update vhost_location_alias.erb this does not affect ruby1.9 --- templates/vhost/vhost_location_alias.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_alias.erb b/templates/vhost/vhost_location_alias.erb index ef36d9f2b..e2ddbdd28 100644 --- a/templates/vhost/vhost_location_alias.erb +++ b/templates/vhost/vhost_location_alias.erb @@ -1,8 +1,8 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> alias <%= @location_alias %>; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> } From e408cdc2f4512e78fe8034833360b7ed4993923d Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:05:38 +0200 Subject: [PATCH 11/15] Update vhost_location_directory.erb this does not affect ruby1.9 --- templates/vhost/vhost_location_directory.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_directory.erb b/templates/vhost/vhost_location_directory.erb index 883e7a224..73af430bd 100644 --- a/templates/vhost/vhost_location_directory.erb +++ b/templates/vhost/vhost_location_directory.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if defined? @www_root -%> @@ -17,7 +17,7 @@ <% if defined? auth_basic_user_file -%> auth_basic_user_file <%= @auth_basic_user_file %>; <% end -%> -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From 2915ff22db19f2fe13e3902943b11c9cca73f296 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:06:23 +0200 Subject: [PATCH 12/15] Update vhost_location_empty.erb this does not affect ruby1.9 --- templates/vhost/vhost_location_empty.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vhost/vhost_location_empty.erb b/templates/vhost/vhost_location_empty.erb index bdec9fd3f..aea023cb6 100644 --- a/templates/vhost/vhost_location_empty.erb +++ b/templates/vhost/vhost_location_empty.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From 81c46e165e76ad79e70155dad5ef030dfbadf817 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:07:06 +0200 Subject: [PATCH 13/15] Update vhost_location_fastcgi.erb --- templates/vhost/vhost_location_fastcgi.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_fastcgi.erb b/templates/vhost/vhost_location_fastcgi.erb index 520bc1dda..73c6c4598 100644 --- a/templates/vhost/vhost_location_fastcgi.erb +++ b/templates/vhost/vhost_location_fastcgi.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if defined? @www_root -%> @@ -16,7 +16,7 @@ <% if defined? @fastcgi_script %> fastcgi_param SCRIPT_FILENAME <%= @fastcgi_script %>; <% end -%> -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From e0f266607715f4e120bbe5d7c6c2fb351aa35d41 Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:07:40 +0200 Subject: [PATCH 14/15] Update vhost_location_proxy.erb this does not affect ruby1.9 --- templates/vhost/vhost_location_proxy.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_proxy.erb b/templates/vhost/vhost_location_proxy.erb index dab034c60..33fe51495 100644 --- a/templates/vhost/vhost_location_proxy.erb +++ b/templates/vhost/vhost_location_proxy.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> <% if @proxy_cache -%> @@ -8,7 +8,7 @@ <% end -%> proxy_pass <%= @proxy %>; proxy_read_timeout <%= @proxy_read_timeout %>; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; <% end -%><% end -%> } From b40196f8430f864fd7929f6252c415b05977407a Mon Sep 17 00:00:00 2001 From: Abdoul Bah Date: Thu, 15 Aug 2013 21:08:03 +0200 Subject: [PATCH 15/15] Update vhost_location_stub_status.erb this does not affect ruby1.9 --- templates/vhost/vhost_location_stub_status.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_stub_status.erb b/templates/vhost/vhost_location_stub_status.erb index 36cc294ab..0827324a9 100644 --- a/templates/vhost/vhost_location_stub_status.erb +++ b/templates/vhost/vhost_location_stub_status.erb @@ -1,8 +1,8 @@ location <%= @location %> { -<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> stub_status on; -<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%> +<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>;<% end -%><% end -%> }