fix virtual host binds
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / static-vhost.conf.erb
index 7cd9939..2610811 100644 (file)
@@ -1,34 +1,75 @@
 # puppet maintained
+<Macro common-dsa-vhost-https-redirect $name>
+       <VirtualHost <%= vhost_listen %> >
+               ServerName $name
+               ServerAdmin debian-admin@lists.debian.org
+
+               CustomLog /var/log/apache2/$name-access.log privacy
+               ErrorLog /var/log/apache2/$name-error.log
+
+               Redirect permanent / https://$name/
+       </VirtualHost>
+</Macro>
+
+<Macro prepare-static-vhost $name>
+<Macro static-vhost-base-$name>
+       ServerAdmin debian-admin@lists.debian.org
 
-<Macro common-static-vhost $name>
-<Macro common-$name>
        <IfModule mod_userdir.c>
                UserDir disabled
        </IfModule>
        ServerSignature On
 
-       DocumentRoot /srv/static.debian.org/cur/$name/
-       <Directory /srv/static.debian.org/cur/$name/>
-               AllowOverride FileInfo
-               Options Multiviews Indexes FollowSymLinks
+       DocumentRoot /srv/static.debian.org/mirrors/$name/cur
+       <Directory /srv/static.debian.org/mirrors/$name/cur>
+               AllowOverride FileInfo Indexes Options=Multiviews
+               Options Indexes SymLinksIfOwnerMatch
                IndexOptions FancyIndexing NameWidth=*
-               Order allow,deny
-               Allow from all
+               Require all granted
        </Directory>
 
+       Header set Surrogate-Key <%= hostname %>
+
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
+
+       Use vstatic-vhost-extra-$name
 </Macro>
 
-<Virtualhost <%= vhost_listen %> >
-       ServerName $name
-       ServerAdmin debian-admin@lists.debian.org
+<Macro static-vhost-plain-$name>
+       <VirtualHost <%= vhost_listen %>>
+               ServerName $name
 
-       ErrorLog /var/log/apache2/$name-error.log
-       CustomLog /var/log/apache2/$name-access.log privacy
+               ErrorLog /var/log/apache2/$name-error.log
+               CustomLog /var/log/apache2/$name-access.log privacy
 
-       Use common-$name
-</VirtualHost>
+               Use static-vhost-base-$name
+       </VirtualHost>
+</Macro>
 
+<Macro static-vhost-onion-$name $onion>
+       <VirtualHost <%= vhost_listen %>>
+               ServerName $onion
+
+               ErrorLog /var/log/apache2/$name-error.log
+               CustomLog /var/log/apache2/$name-access.log privacy
+
+               Use static-vhost-base-$name
+       </VirtualHost>
+</Macro>
+
+<Macro static-vhost-ssl-$name>
+       <VirtualHost <%= vhost_listen_443 %>>
+               ServerName $name
+
+               ErrorLog /var/log/apache2/$name-error.log
+               CustomLog /var/log/apache2/$name-access.log privacyssl
+
+               Use common-debian-service-ssl $name
+               Use common-ssl-HSTS
+
+               Use static-vhost-base-$name
+       </VirtualHost>
+</Macro>
 </Macro>
 
 # vim:ft=apache: