ansible-role-website/templates/apache.conf.j2

16 lines
534 B
Django/Jinja

<VirtualHost *:80>
ServerName {{ domainname }}
ServerAdmin webmaster@{{ domainname }}
DocumentRoot "{{ docroot }}"
ErrorLog ${APACHE_LOG_DIR}/{{ domainname }}.error.log
CustomLog ${APACHE_LOG_DIR}/{{ domainname }}.access.log combined
#rewrite transparent to https, keep uri
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</VirtualHost>