HTTP_PROXY
Specifies the proxy server URL for HTTP requests. Used by many command-line tools (curl, wget, apt), package managers (npm, pip), and programming language HTTP clients. The format is typically http://[user:password@]host:port.
Last updated:
HTTP_PROXY points outbound HTTP traffic through a proxy server, in the form http://[user:password@]host:port. It is a de-facto convention rather than a standard, honored by curl, wget, apt, pip, and most language HTTP stacks — but adoption is uneven, which is the whole problem. Pair it with HTTPS_PROXY (for TLS traffic) and NO_PROXY (for exceptions); setting only HTTP_PROXY rarely does what people expect, because most traffic today is HTTPS and ignores it. Both lowercase (http_proxy) and uppercase forms exist, and not every tool reads both.
- Provider
- General / OS
- Category
- network
- Set by
- Set manually or via corporate network configuration
- Example
- http://proxy.example.com:8080
How to set HTTP_PROXY
bash (set the trio together)
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=$HTTP_PROXY
export NO_PROXY=localhost,127.0.0.1,.internalDocker build args
docker build \
--build-arg HTTP_PROXY=http://proxy:8080 \
--build-arg HTTPS_PROXY=http://proxy:8080 -t myapp .References
Frequently Asked Questions
Should I set http_proxy lowercase or HTTP_PROXY uppercase?
Set both to be safe, but prefer lowercase for HTTP traffic: due to the 2016 httpoxy vulnerability, curl and libcurl-based tools ignore the uppercase HTTP_PROXY when running in a CGI context to avoid being hijacked by a client-supplied Proxy header. HTTPS_PROXY and NO_PROXY do not have this caveat.
Stay up to date
Get notified about new guides, tools, and cheatsheets.
Related Variables
HTTPS_PROXY
Specifies the proxy server URL for HTTPS requests. Most tools check both HTTP_PROXY and HTTPS_PROXY separately. Can point to either an HTTP or HTTPS proxy server. In many environments, this is set to the same value as HTTP_PROXY.
NO_PROXY
A comma-separated list of hostnames, domain suffixes, or IP addresses that should bypass the proxy. Supports wildcards in some implementations. Used to exclude internal services, localhost, and private network addresses from proxy routing.