From 6edb858f8f13937453b24678f8c46d3539237530 Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Tue, 28 Oct 2014 17:40:14 +0000
Subject: [PATCH] Auto redirects to https

---
 confd/templates/haproxy.cfg.tmpl | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/confd/templates/haproxy.cfg.tmpl b/confd/templates/haproxy.cfg.tmpl
index 344745d..64613f4 100644
--- a/confd/templates/haproxy.cfg.tmpl
+++ b/confd/templates/haproxy.cfg.tmpl
@@ -38,17 +38,7 @@ default_backend {{$default_service.hostname}}
 
 frontend http-in
   bind *:80
-{{range $app := lsdir "/services"}}
-{{$hostnames := printf "/services/%s/*" $app}}
-  {{range gets $hostnames}}
-    {{$hostname := .Key}}
-    {{$data := json .Value}}
-# {{base $hostname}}:
-  acl is_{{base $hostname}} hdr(host) -i {{base $hostname}}
-  acl is_{{base $hostname}} hdr(host) -i www.{{base $hostname}}
-  use_backend {{base $hostname}} if is_{{base $hostname}}
-  {{end}}
-{{end}}
+  redirect scheme https code 301 if !{ ssl_fc }
 
 {{range $app := lsdir "/services"}}
 {{$hostnames := printf "/services/%s/*" $app}}
-- 
GitLab