lib: include custom config when redirecting to https in webSsl
authorClinton Ebadi <clinton@unknownlamer.org>
Wed, 6 Mar 2019 03:31:52 +0000 (22:31 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Wed, 6 Mar 2019 03:31:52 +0000 (22:31 -0500)
The custom config provided to webSsl might include critical directives
like `serverAliasDefault', so we need to include it when `ForceSSL' is
enabled.

The https rewrite should override any other rewrites or aliases, so
this shouldn't pose any problems.

lib/easy_domain.dtl

index 26de1b1..ee8e82d 100644 (file)
@@ -53,6 +53,10 @@ val webSsl = \ host -> \ certFile -> \\ config : Vhost -> begin
       SSL = no_ssl;
     with
       rewriteRule "^(.*)$" "https://%{HTTP_HOST}$1" [redirect];
+
+      config; (* config is included in case of directives like
+                 serverAliasDefault. https rewrite should override all
+                 others since it matches first. *)
     end;
   else
     webAt n host where