From a6182c74cbe60abf9d9dcd4e9195bf37495163b1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 9 Jun 2018 14:35:22 -0500 Subject: [PATCH] roles/zabbix-server: Redirect HTTP -> HTTPS --- roles/zabbix-server/templates/zabbix-redir.httpd.conf.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/zabbix-server/templates/zabbix-redir.httpd.conf.j2 b/roles/zabbix-server/templates/zabbix-redir.httpd.conf.j2 index ad9dca2..da6a5c0 100644 --- a/roles/zabbix-server/templates/zabbix-redir.httpd.conf.j2 +++ b/roles/zabbix-server/templates/zabbix-redir.httpd.conf.j2 @@ -3,4 +3,12 @@ # Automatically redirect requests for / to /zabbix/ {% if zabbix_web_redir|bool %} RedirectMatch 301 ^/$ /zabbix/ + +RewriteEngine On +RewriteCond %{HTTPS} !on +RewriteRule /.* https://%{SERVER_NAME}$0 [R=301,L] + +Header always set \ + Strict-Transport-Security "max-age=63072000; includeSubDomains" + {% endif %}