From 6f402c3dfbc3d4702c1b758f60afbec912ca2c24 Mon Sep 17 00:00:00 2001 From: binary Date: Sun, 24 Jan 2021 16:42:45 +0100 Subject: Force http to https with httpd block return from relayd --- roles/httpd/templates/httpd.conf.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'roles/httpd') diff --git a/roles/httpd/templates/httpd.conf.j2 b/roles/httpd/templates/httpd.conf.j2 index 45b46c3..9a028f9 100644 --- a/roles/httpd/templates/httpd.conf.j2 +++ b/roles/httpd/templates/httpd.conf.j2 @@ -12,6 +12,15 @@ types { image/png png } +{% if ansible_host == global.dcontroller %} +server "default" { + listen on localhost port 8888 + location * { + block return 302 "https://\$HTTP_HOST\$REQUEST_URI" + } +} +{% endif %} + {% for file in configurations.files %} include "{{ file.path }}" {% endfor %} -- cgit v1.2.3