From 323a8ddd1aeb208c42dcd4e60babdfb830754d08 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 15 Feb 2022 08:22:09 +0200 Subject: apache_server: redirect also https site Sponsored-by: author --- roles/apache_server/templates/virtualhost.conf.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/apache_server/templates/virtualhost.conf.tmpl b/roles/apache_server/templates/virtualhost.conf.tmpl index f8d4c47..1e14db5 100644 --- a/roles/apache_server/templates/virtualhost.conf.tmpl +++ b/roles/apache_server/templates/virtualhost.conf.tmpl @@ -50,6 +50,10 @@ CustomLog /var/log/apache2/{{ item.domain }}/access.log combined Options +SymlinksIfOwnerMatch +Indexes +MultiViews +{% if item.redirect|default(false) %} + Redirect permanent / "https://{{ item.redirect }}/" + Require all granted +{% else %} {% if item.htpasswd is defined %} AuthType Basic AuthName "{{ item.htpasswd_name }}" @@ -58,6 +62,7 @@ {% else %} AllowOverride AuthConfig Require all granted +{% endif %} {% endif %} -- cgit v1.2.1