Score:0

Make nginx look for credentials in "Proxy-Authorization" header, so it works with apt

us flag

I have an nginx in front of an apt-cacher-ng. The nginx's job is to terminate HTTPS and take care of authentication.

The issue is, that nginx will look in the Authorization header for credentials, but when I configure apt to use a proxy, it will send the credentials in the Proxy-Authorization header. So apt gets 401 as a response.

Is there a way to make nginx look for credentials in the Proxy-Authorization header?

Score:0
us flag

I found a workaround:

Instead of using the http_proxy env-variable or Acquire::http::proxy in apt.conf, I can change the sources.list as described in the apt-cacher-ng documentation and apt will use the correct header.
For example: deb http://deb.debian.org/debian buster main becomes deb https://apt-cache.example.com/deb.debian.org/debian buster main

I would still be interested in the "clean" solution, though.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.