[Apt-cacher-ng-users] As a work-around to Debian Installer bug 642159, can apt-cacher-ng serve local files through a proxy request?

Alexander Perlis aperlis at math.lsu.edu
Fri Feb 22 22:29:38 UTC 2013


I have apt-cacher-ng version 0.7.2 running on host 4.3.2.1 port 3142, 
and I would like it to handle proxy requests for local files, e.g.:

   GET http://4.3.2.1/somedir/somefile HTTP/1.1
   Host: 4.3.2.1

The apt-cacher-ng configuration has

   LocalDirs somedir /path/to/somedir

yet the request above results in a 403 error. If I make it a non-proxy 
request,

   GET /somedir/somefile HTTP/1.1
   Host: 4.3.2.1

then apt-cacher-ng does serve up the file, confirming that LocalDirs is 
specified correctly. Unfortunately I don't control the request, which is 
coming from the Debian Installer (to load preseed scripts) and is 
incorrectly proxied due to a Debian Installer bug:
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=642159

Thus, to work around that bug, I need apt-cacher-ng to serve up the 
local file in the context of a proxy request. I also tried the following 
configuration line but no behavior change:

   Remap-somedir /somedir ; http://4.3.2.1/somedir

It seems in this case apt-cacher-ng should ignore the hostname of the 
incoming proxy request, match the /somedir portion, and then attempt a 
connection to 4.3.2.1:80, where I do have a webserver who would happily 
serve up the file. But apt-cacher-ng doesn't connect to port 80, nor 
serve up the file directly; instead, it returns the 403 error.

What am I doing wrong?

Or if apt-cacher-ng 0.7.2 can't do this, then this message is a feature 
request / bug report. With the LocalDirs configuration, apt-cacher-ng 
becomes a combination proxy+localfile server, so presumably should 
handle proxy requests to local files?



More information about the Apt-cacher-ng-users mailing list