diff options
Diffstat (limited to 'roles/apache_server/templates/virtualhost.conf.tmpl')
-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 8d069ce..f8d4c47 100644 --- a/roles/apache_server/templates/virtualhost.conf.tmpl +++ b/roles/apache_server/templates/virtualhost.conf.tmpl @@ -8,6 +8,10 @@ ErrorLog /var/log/apache2/{{ item.domain }}/error.log CustomLog /var/log/apache2/{{ item.domain }}/access.log combined <Directory /srv/http/{{ item.domain }}> +{% if item.redirect|default(false) %} + Redirect permanent / "https://{{ item.redirect }}/" + Require all granted +{% else %} {% if item.letsencrypt|default(false) %} Redirect permanent / "https://{{ item.domain }}/" Require all granted @@ -23,6 +27,7 @@ Require all granted {% endif %} {% endif %} +{% endif %} </Directory> Alias /.well-known/ /srv/letsencrypt/{{ item.domain }}/ |