2022-08-04 17:32:06 +02:00
|
|
|
{% if 'address' in ansible_default_ipv6 %}
|
2020-12-06 13:22:54 +01:00
|
|
|
<VirtualHost {{ ansible_default_ipv4.address }}:80 [{{ ansible_default_ipv6.address }}]:80>
|
2022-08-04 17:32:06 +02:00
|
|
|
{% else %}
|
|
|
|
<VirtualHost {{ ansible_default_ipv4.address }}:80>
|
|
|
|
{% endif %}
|
2020-12-04 18:52:18 +01:00
|
|
|
ServerAdmin {{ server_admin }}
|
|
|
|
ServerName {{ site_name }}
|
|
|
|
ServerAlias {{ site_name }}
|
|
|
|
ErrorLog /var/log/apache2/{{ site_name }}-error.log
|
|
|
|
CustomLog /var/log/apache2/{{ site_name }}-access.log common
|
|
|
|
|
|
|
|
Alias /.well-known/acme-challenge /usr/local/etc/dehydrated/challenge
|
|
|
|
|
|
|
|
<ifmodule mod_rewrite.c>
|
|
|
|
RewriteEngine On
|
|
|
|
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
|
|
|
|
RewriteRule (.*) {{forward_to}} [R=301,L]
|
|
|
|
</ifmodule>
|
|
|
|
</VirtualHost>
|
|
|
|
|
2020-12-12 16:26:12 +01:00
|
|
|
<IfFile /usr/local/etc/dehydrated/certs/{{ site_name }}>
|
2022-08-04 17:32:06 +02:00
|
|
|
{% if 'address' in ansible_default_ipv6 %}
|
2021-11-23 14:42:04 +01:00
|
|
|
<VirtualHost {{ ansible_default_ipv4.address }}:443 [{{ ansible_default_ipv6.address }}]:443>
|
2022-08-04 17:32:06 +02:00
|
|
|
{% else %}
|
|
|
|
<VirtualHost {{ ansible_default_ipv4.address }}:443>
|
|
|
|
{% endif %}
|
2020-12-04 18:52:18 +01:00
|
|
|
ServerAdmin {{ server_admin }}
|
|
|
|
ServerName {{ site_name }}
|
|
|
|
ServerAlias {{ site_name }}
|
|
|
|
|
|
|
|
ErrorLog /var/log/apache2/{{ site_name }}-error.log
|
|
|
|
CustomLog /var/log/apache2/{{ site_name }}-access.log common
|
|
|
|
|
|
|
|
SSLEngine on
|
|
|
|
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
|
|
|
|
SSLCertificateFile /usr/local/etc/dehydrated/certs/{{ site_name }}/cert.pem
|
|
|
|
SSLCertificateKeyFile /usr/local/etc/dehydrated/certs/{{ site_name }}/privkey.pem
|
|
|
|
SSLCertificateChainFile /usr/local/etc/dehydrated/certs/{{ site_name }}/chain.pem
|
|
|
|
|
|
|
|
Alias /.well-known/acme-challenge /usr/local/etc/dehydrated/challenge
|
|
|
|
|
|
|
|
<ifmodule mod_rewrite.c>
|
|
|
|
RewriteEngine On
|
|
|
|
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
|
|
|
|
RewriteRule (.*) {{forward_to}} [R=301,L]
|
|
|
|
</ifmodule>
|
|
|
|
</VirtualHost>
|
2020-12-12 16:26:12 +01:00
|
|
|
</IfFile>
|