If like me you are or have been confronted with corporate proxies mess 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
And add the following lines in the file
proxy.conf. Create it if it doesn't exist.
git config --global http.proxy <http://proxyUsername:proxyPassword@proxy.server.com>:port
git config --global https.proxy <https://proxyUsername:proxyPassword@proxy.server.com>:port
npm config set proxy "<http://"username:password"@proxy.big-corp.com>"
npm config set https-proxy "<http://"username:password"@proxy.big-corp.com>"
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.0ARG HTTP_PROXYWORKDIR /server
COPY package*.json ./
RUN npm config set proxy $HTTP_PROXY
RUN npm install
ARG HTTP_PROXY declares a docker variable that you can pass when building your container.
RUN npm config set proxy $HTTP_PROXY line sets the proxy for the npm instance running in your container.
Edit your docker-compose file
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.
Edit or create the file located at
And add this line :
proxy = <http://username:password@ip>:port