With `HTTPS_PROXY` set on a server, internet calls work but calls to `https://api.internal.corp` now fail with `502` from the proxy.
BeginnerTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer
Likely causes → The internal call is also being sent to the corporate proxy, which can't reach internal names. NO_PROXY doesn't include the internal domain or IP ranges.
Diagnose →
env | grep -i _proxy
curl -v https://api.internal.corp 2>&1 | grep -iE 'proxy|connected to'
Fix →
export NO_PROXY=localhost,127.0.0.1,.internal.corp,10.0.0.0/8,169.254.169.254
export no_proxy=$NO_PROXY
Use the leading-dot domain form; CIDR support varies by tool (curl and Go support it, some older tools don't), so also list key IPs if needed.
Prevent → Set both upper- and lowercase variants centrally (e.g. /etc/environment, systemd drop-ins), and always include the metadata IP and cluster ranges.
More on Cloud networking: VPC, firewalls, NAT, VPN and proxies
An EC2 instance in a private subnet hangs on `apt-get update` at `Connecting to archive.ubuntu.com`.BeginnerA new EC2 instance in a "public" subnet can't be reached over SSH from the internet; the SG allows port 22 from your IP.BeginnerThe SG allows inbound 443 and the app works from inside the VPC, but internet clients time out. The subnet NACL allows inbound 443.IntermediateA VPC peering connection is `Active`, but instances in the two VPCs can't ping each other.BeginnerALB targets are `unhealthy` with reason `Target.Timeout`, and VPC Flow Logs show `REJECT` from the ALB's IPs to the instances.BeginnerTwo VPCs are attached to a Transit Gateway, but traffic between them fails.Intermediate