Add SSL related apache macros
[mirror/dsa-puppet.git] / modules / apache2 / files / puppet-ssl-macros
1 <IfModule mod_ssl.c>
2   <IfModule mod_macro.c>
3     <Macro common-ssl-HSTS>
4       # Add two month HSTS header
5       Header always add Strict-Transport-Security "max-age=5184000"
6     </Macro>
7
8     <Macro common-debian-service-ssl $name>
9       SSLEngine on
10       SSLCertificateFile    /etc/ssl/debian/certs/$name.crt
11       SSLCertificateKeyFile /etc/ssl/private/$name.key
12       SSLCertificateChainFile /etc/ssl/debian/certs/$name.crt-chain
13     </Macro>
14
15     <Macro common-debian-service-https-redirect $bind $name>
16       <VirtualHost $bind:80>
17         ServerName $name
18         ServerAdmin debian-admin@lists.debian.org
19
20         CustomLog /var/log/apache2/$name-access.log privacy
21         ErrorLog /var/log/apache2/$name-error.log
22
23         Redirect permanent / https://$name/
24       </VirtualHost>
25     </Macro>
26   </IfModule>
27 </IfModule>