add back our git reversion
[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                 Require all granted
28         </Directory>
29
30         Header set Surrogate-Key <%= hostname %>
31
32         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
33
34         Use vstatic-vhost-extra-$name
35 </Macro>
36
37 <Macro static-vhost-plain-$name>
38         <VirtualHost <%= vhost_listen %>>
39                 ServerName $name
40
41                 ErrorLog /var/log/apache2/$name-error.log
42                 CustomLog /var/log/apache2/$name-access.log privacy
43
44                 Use static-vhost-base-$name
45         </VirtualHost>
46 </Macro>
47
48 <Macro static-vhost-onion-$name $onion>
49         <VirtualHost <%= vhost_listen %>>
50                 ServerName $onion
51
52                 ErrorLog /var/log/apache2/$name-error.log
53                 CustomLog /var/log/apache2/$name-access.log privacy
54
55                 Use static-vhost-base-$name
56         </VirtualHost>
57 </Macro>
58
59 <Macro static-vhost-ssl-$name>
60         <VirtualHost <%= vhost_listen_443 %>>
61                 ServerName $name
62
63                 ErrorLog /var/log/apache2/$name-error.log
64                 CustomLog /var/log/apache2/$name-access.log privacyssl
65
66                 Use common-debian-service-ssl $name
67                 Use common-ssl-HSTS
68                 Use http-pkp-$name
69
70                 Use static-vhost-base-$name
71         </VirtualHost>
72 </Macro>
73 </Macro>
74
75 # vim:ft=apache: