Add redirect for lighttpd
authorDavid Durvaux <info@autopsit.org>
Tue, 12 Nov 2013 17:03:11 +0000 (18:03 +0100)
committerDavid Durvaux <info@autopsit.org>
Tue, 12 Nov 2013 17:03:11 +0000 (18:03 +0100)
src/practical_settings.tex

index df37c5b..c191930 100644 (file)
@@ -203,8 +203,15 @@ You should redirect everything to httpS:// if possible. In Apache you can do thi
   }
 \end{verbatim}
 
-%% ADD Rewrite rule from tcp/80 -> tcp/443
-
+\begin{verbatim}
+  $HTTP["scheme"] == "http" {
+    # capture vhost name with regex conditiona -> %0 in redirect pattern
+    # must be the most inner block to the redirect rule
+    $HTTP["host"] =~ ".*" {
+        url.redirect = (".*" => "https://%0$0")
+    }
+  }
+\end{verbatim}
 
 \subsubsection{nginx}