Definition
Proxy environment variables provide process-level proxy configuration to applications that support them. Common names include HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY, but behavior is client-specific.
Destination selection and proxy scheme
HTTPX documents HTTP_PROXY and HTTPS_PROXY as proxy settings for HTTP and HTTPS requests respectively, with ALL_PROXY covering all requests. The variable’s name identifies the request category; the value is a proxy URL.
An illustrative HTTPS_PROXY value can begin with http:// when the client uses an HTTP proxy to establish CONNECT tunnels for HTTPS destinations. The HTTPS in the variable name does not prove that the connection to the proxy uses TLS. Validate both the destination scheme and the proxy’s supported scheme.
Configuration belongs to a process
An application must inherit the environment and recognize the relevant variables. A terminal setting does not prove that an already-running service, container, or browser uses it. Nor does it establish that every network library has identical precedence or uppercase/lowercase handling.
HTTPX uses environment configuration by default and documents trust_env=False for ignoring it. curl documents that an explicit --proxy option overrides proxy environment settings. Check the specific client rather than assuming one rule across every tool.
Diagnose the effective path
Inspect the effective configuration without printing credentials. Include exclusions such as NO_PROXY, because they may direct some destinations around the proxy. Test an authorized destination through the same process that runs the real workload.
Keep credential-bearing values out of logs, screenshots, and shared shell histories. Environment-based configuration is convenient, but it does not turn a password into non-sensitive data or automatically protect the transport.
Sources
Sources checked on November 18, 2026. Examples are illustrative, not measurements of a live proxy service.
Related concepts
Frequently asked questions
Does HTTPS_PROXY require an https:// value?
No. In clients such as HTTPX, an HTTP proxy can carry HTTPS destination traffic using a tunnel.
Will every application use these variables?
No. Support, precedence, and inherited configuration vary by application.
Why does a request go direct despite a proxy variable?
Check client support, explicit configuration, environment inheritance, and NO_PROXY exclusions.