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