# Proxy Settings Note
Edit - 2019.09.16
- Add/Edit Git section.
- Add command for NPM proxy
- Fix typo
There are so many different system or tool configs to set if you are behind a proxy. This article simply note where and how to set them.
I will use these settings for the following example:
- Proxy Host: host
- Proxy Port: 3128
- Proxy User: username
- Proxy Password: password
WARNING
You need to URL encode your username or password if special characters contains.
i.g. whitespace = %20
, & = %26
, etc...
# Ubuntu
Config file path: /etc/environment
http_proxy="http://username:password@host:3128"
http_proxy_request_fulluri=1
https_proxy="http://username:password@host:3128"
https_proxy_request_fulluri=0
no_proxy="localhost, 127.0.*, 192.168.*, 10.*, *.local"
HTTP_PROXY="http://username:password@host:3128"
HTTP_PROXY_REQUEST_FULLURI=1
HTTPS_PROXY="http://username:password@host:3128"
HTTPS_PROXY_REQUEST_FULLURI=0
NO_PROXY="localhost, 127.0.*, 192.168.*, 10.*, *.local"
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# apt-get
Config file path: /etc/apt/apt.conf.d/95proxies
Acquire::http::proxy "http://username:password@host:3128";
Acquire::https::proxy "http://username:password@host:3128";
Acquire::ftp::proxy "ftp://username:password@host:3128";
1
2
3
2
3
# NPM
npm config set proxy http://username:password@host:3128
npm config set https-proxy http://username:password@host:3128
1
2
2
or manually add in config file path: ~/.npmrc
proxy=http://username:password@host:3128/
https-proxy=http://username:password@host:3128/
strict-ssl=false
registry=http://registry.npmjs.org/
1
2
3
4
2
3
4
# Git
git config --global http.proxy http://username:password@host:3128
git config --global https.proxy http://username:password@host:3128
1
2
2
or manually add in config file path: ~/.gitconfig
[http]
proxy = http://username:password@host:3128
[https]
proxy = http://username:password@host:3128
1
2
3
4
2
3
4