AWS Cloud9设置应用公开后推送GitHub遇443连接超时错误的解决
Hey there, let’s break down exactly what’s causing this connection timeout and how to fix it—this is a common gotcha when configuring public previews in Cloud9.
When you follow the steps to make your Cloud9 app preview public, the most likely culprit is a change to your environment’s outbound network rules that blocks access to GitHub’s HTTPS port (443).
Here’s the breakdown:
- The public preview setup often involves adjusting security groups or network ACLs to expose your app’s port to the internet. It’s easy to accidentally restrict all outbound traffic to only that app port, cutting off Git’s ability to reach GitHub.
- In some cases, enabling public preview can alter the environment’s network routing (e.g., forcing traffic through a proxy that doesn’t allow GitHub access) or interfere with Git’s default network configuration.
9 times out of 10, it’s one of these two:
- Security Group Outbound Rules: You might have updated the security group to only allow outbound traffic on your app’s port (like 80 or 3000) and removed/replaced the rule that allowed HTTPS traffic to GitHub.
- Network ACL Rules: If your Cloud9 environment’s VPC subnet uses network ACLs, you might have added an outbound deny rule that blocks port 443, or failed to explicitly allow traffic to GitHub’s IP ranges.
- Less commonly: The app preview setup could have overridden Git’s proxy settings, preventing it from making normal HTTPS connections.
Let’s walk through the fixes in order of likelihood:
1. Fix Your Cloud9 Security Group’s Outbound Rules
- Head to the AWS Console, navigate to your Cloud9 environment’s details page, and find the linked security group under Environment settings > Network.
- Edit the outbound rules:
- Add a new rule with Type = HTTPS, Protocol = TCP, Port Range = 443, and Destination = 0.0.0.0/0 (or narrow it to GitHub’s IP ranges if you need tighter security).
- Alternatively, if your security policies allow, keep a default rule that allows all outbound traffic (this is the default for Cloud9 environments initially).
- Test it: Run
curl -v https://github.comin your Cloud9 terminal—if you get a valid HTML response, your network access is restored.
2. Check and Adjust Network ACLs
- Go to the VPC Console, find the network ACL attached to your Cloud9 subnet.
- Verify the outbound rules:
- Ensure there’s a rule allowing TCP port 443 to any destination (rule numbers matter—allow rules need to come before any deny rules).
- Double-check inbound rules allow return traffic (network ACLs are stateless, so you need to allow ephemeral return ports for HTTPS).
3. Reset Git’s Proxy Configuration
If the issue is proxy-related, run these commands in your Cloud9 terminal to clear any overridden proxy settings:
git config --global --unset http.proxy git config --global --unset https.proxy
Then try your push again: git push origin your-branch-name
4. Verify Network Routing
- Confirm your Cloud9 subnet has access to the internet: Either it’s connected to an Internet Gateway (IGW), or uses a NAT Gateway if it’s a private subnet. GitHub doesn’t have a VPC endpoint, so your environment needs public internet access to reach it.
Run these in your Cloud9 terminal to narrow down the issue:
- Test DNS resolution:
nslookup github.com(should return valid IP addresses) - Test port connectivity:
telnet github.com 443(if it connects, the port is open; if it times out, network rules are blocking it)
内容的提问来源于stack exchange,提问作者adam tropp




