summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-22 23:53:29 +0100
committermh <mh@immerda.ch>2011-02-22 23:53:29 +0100
commit33c5ede6de31667d5f2a2797b1aab2d98db8a6ae (patch)
treee7598f791b412c6127e87571fcf0d12190d1c6b5 /templates
parent420b74afaa1a222b3fc17c8bf91b2890aef3232d (diff)
fixing mode stuff
Diffstat (limited to 'templates')
-rw-r--r--templates/vhosts/default.erb11
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb
index 4a7d7f4..172518c 100644
--- a/templates/vhosts/default.erb
+++ b/templates/vhosts/default.erb
@@ -1,4 +1,11 @@
-<%- [:normal,:ssl].each do |vhost_part|
+<%-
+vhost_parts = case ssl_mode
+ when 'only' then [:ssl]
+ when false then [:normal]
+ when 'false' then [:normal]
+ else [:normal,:ssl]
+end
+vhost_parts.each do |vhost_part|
# we need this variable in included templates
@vhost_part = vhost_part
%>
@@ -7,7 +14,7 @@
<%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
- <%- if ssl_mode == 'force' && vhost_part == :ssl %>
+ <%- if ssl_mode == 'force' && vhost_part == :normal %>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]