Proxy Inferno

Proxy Inferno

If like me you are or have been confronted with corporate proxies bullshit and whatnot, you might understand this article's title. I cannot even count the amount of time I have lost trying to make things work, fiddling, googling, etc. After running into so many walls, I decided to document my journey through Proxy Hell, one of the missing circles of Hell as described in Dante's Inferno. This list isn't exhaustive but represents the many configurations I had to set up in my former position. Hopefully, it will be of use to you.


Create a new file in /etc/apt/apt.conf.d/ And add the following lines in the file proxy.conf. Create it if it doesn't exist.

Acquire::http::Proxy "http://user:password@proxy.server:port/";
Acquire::https::Proxy "http://user:password@proxy.server:port/";


git config --global http.proxy <>:port
git config --global https.proxy <>:port


npm config set proxy "<http://"username:password">"
npm config set https-proxy "<http://"username:password">"

If you're running nodejs INSIDE a Docker container you might have to set the proxy for the npm running INSIDE the container before running npm install. Otherwise the install just won't work when building your containers.


FROM node:14.2.0


WORKDIR /server
COPY package*.json ./
RUN npm config set proxy $HTTP_PROXY
RUN npm install

This line: ARG HTTP_PROXY declares a docker variable that you can pass when building your container. The RUN npm config set proxy $HTTP_PROXY line sets the proxy for the npm instance running in your container.

Edit your docker-compose file

      context: .

It has to be under the build section. Here I set the proxy by calling my machine's environment variable. You can also hardcode the proxy value but it's not really safe.

      context: .
        HTTP_PROXY: <http://"username:password">


Edit or create the file located at ~/.curlrc And add this line :

proxy = <http://username:password@ip>:port