Enable HPKP for all static sites
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / static-vhost.conf.erb
1 # puppet maintained
2 <Macro common-dsa-vhost-https-redirect $name>
3         <VirtualHost <%= vhost_listen %> >
4                 ServerName $name
5                 ServerAdmin debian-admin@lists.debian.org
6
7                 CustomLog /var/log/apache2/$name-access.log privacy
8                 ErrorLog /var/log/apache2/$name-error.log
9
10                 Redirect permanent / https://$name/
11         </VirtualHost>
12 </Macro>
13
14 <Macro prepare-static-vhost $name>
15 <Macro static-vhost-base-$name>
16         ServerAdmin debian-admin@lists.debian.org
17
18         <IfModule mod_userdir.c>
19                 UserDir disabled
20         </IfModule>
21         ServerSignature On
22
23         DocumentRoot /srv/static.debian.org/mirrors/$name/cur
24         <Directory /srv/static.debian.org/mirrors/$name/cur>
25                 AllowOverride FileInfo Indexes Options=Multiviews
26                 Options Indexes SymLinksIfOwnerMatch
27                 IndexOptions FancyIndexing NameWidth=*
28                 Require all granted
29         </Directory>
30
31         Header set Surrogate-Key <%= hostname %>
32
33         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
34
35         Use vstatic-vhost-extra-$name
36 </Macro>
37
38 <Macro static-vhost-plain-$name>
39         <VirtualHost <%= vhost_listen %>>
40                 ServerName $name
41
42                 ErrorLog /var/log/apache2/$name-error.log
43                 CustomLog /var/log/apache2/$name-access.log privacy
44
45                 Use static-vhost-base-$name
46         </VirtualHost>
47 </Macro>
48
49 <Macro static-vhost-onion-$name $onion>
50         <VirtualHost <%= vhost_listen %>>
51                 ServerName $onion
52
53                 ErrorLog /var/log/apache2/$name-error.log
54                 CustomLog /var/log/apache2/$name-access.log privacy
55
56                 Use static-vhost-base-$name
57         </VirtualHost>
58 </Macro>
59
60 <Macro static-vhost-ssl-$name>
61         <VirtualHost <%= vhost_listen_443 %>>
62                 ServerName $name
63
64                 ErrorLog /var/log/apache2/$name-error.log
65                 CustomLog /var/log/apache2/$name-access.log privacyssl
66
67                 Use common-debian-service-ssl $name
68                 Use common-ssl-HSTS
69                 Use http-pkp-$name
70
71                 Use static-vhost-base-$name
72         </VirtualHost>
73 </Macro>
74 </Macro>
75
76 # vim:ft=apache: