All www and static mirrors run jessie
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / lintian.debian.org.erb
1 <% if scope.function_has_static_component(['lintian.debian.org']) -%>
2
3 Use common-dsa-vhost-https-redirect lintian.debian.org
4
5 <Virtualhost <%= vhost_listen_443 %> >
6         ServerName lintian.debian.org
7         ServerAdmin lintian-maint@debian.org
8
9         ErrorLog /var/log/apache2/lintian.debian.org-error.log
10         CustomLog /var/log/apache2/lintian.debian.org-access.log privacyssl
11
12         Use common-debian-service-ssl lintian.debian.org
13         Use common-ssl-HSTS
14
15         <IfModule mod_userdir.c>
16                 UserDir disabled
17         </IfModule>
18
19         DocumentRoot /srv/static.debian.org/mirrors/lintian.debian.org/cur
20         AddDefaultCharset utf-8
21
22         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur>
23                 Require all granted
24
25                 # These three lines makes apache serve
26                 # "lintian.log.gz" as a text/plain with encoding gzip
27                 # making it easier to view the log in the browser.
28                 RemoveType .gz
29                 AddEncoding x-gzip .gz
30                 AddType text/plain .log
31
32                 <IfModule mod_userdir.c>
33                         AddOutputFilterByType DEFLATE image/svg+xml
34                         AddOutputFilterByType DEFLATE text/plain
35                 </IfModule>
36         </Directory>
37
38         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/resources>
39                 # Cache these for a year (3600 * 24 * 365.25)
40                 # Files in here will change name if their content change
41                 Header set Cache-Control "max-age=31557600, public"
42         </Directory>
43
44         RewriteEngine on
45         RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages
46
47         # Re-direct from the "old" locations to the new ones
48         RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent]
49         RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent]
50
51         # Map source packages to reports (this mapping is re-written once per lintian run,
52         # serve it as a 302 rather than a permanent redirect)
53         # Version-less request
54         RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE]
55         # Versioned request
56         RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE]
57 </VirtualHost>
58 <% end -%>
59
60 # vim:set syn=apache: