diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-02-15 08:22:09 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-02-15 08:22:09 +0200 |
commit | 323a8ddd1aeb208c42dcd4e60babdfb830754d08 (patch) | |
tree | 5d2b8124c3179d2cc0494c10eeee6465596df13a /roles/apache_server/templates | |
parent | b91cb62deb6c2f3e72c4a5dd8004237929056729 (diff) | |
download | debian-ansible-323a8ddd1aeb208c42dcd4e60babdfb830754d08.tar.gz |
apache_server: redirect also https site
Sponsored-by: author
Diffstat (limited to 'roles/apache_server/templates')
-rw-r--r-- | roles/apache_server/templates/virtualhost.conf.tmpl | 5 |
1 files changed, 5 insertions, 0 deletions
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 <Directory /srv/http/{{ item.domain }}> 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 }}" @@ -59,6 +63,7 @@ AllowOverride AuthConfig Require all granted {% endif %} +{% endif %} </Directory> SSLEngine on |