Redirect /debian* on deb.d.o to cdn-fastly
authorPeter Palfrader <peter@palfrader.org>
Tue, 12 Apr 2016 15:25:12 +0000 (17:25 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 12 Apr 2016 15:25:12 +0000 (17:25 +0200)
SRV support in apt only helps when there is no http proxy (transparent
or directly configured).  If there is a proxy, and it doesn't support
SRV records as well, requests end up directly on the deb.d.o vhost.

Do something smart in that case, namely redirect to cdn-fastly.

modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb

index 48cb490..7784d04 100644 (file)
@@ -44,11 +44,22 @@ vhost(lines, "es.debconf.org"      , "ssl")
 vhost(lines, "fr.debconf.org"      , "ssl")
 vhost(lines, "miniconf10.debconf.org" , "ssl")
 
-vhost(lines, "deb.debian.org")
+vhost(lines, "deb.debian.org", "with-extra", '"Use vhost-deb.debian.org-extra"')
 
 lines.join("\n")
 -%>
 
+
+######################
+# deb.debian.org
+<% if scope.function_has_static_component(['deb.debian.org']) -%>
+<Macro vhost-deb.debian.org-extra>
+       RedirectPermanent /debian/           http://cdn-fastly.deb.debian.org/debian/
+       RedirectPermanent /debian-debug/     http://cdn-fastly.deb.debian.org/debian-debug/
+       RedirectPermanent /debian-security/  http://cdn-fastly.deb.debian.org/debian-security/
+</Macro>
+<% end -%>
+
 ######################
 # metadata.ftp-master.debian.org
 <% if scope.function_has_static_component(['metadata.ftp-master.debian.org']) -%>