2 個答案
- 最新
- 最多得票
- 最多評論
0
https://www.uvicorn.org/#usage
The default interface for uvicorn is 127.0.0.1.
Specify the --host
parameter when starting uvicorn, e.g., uvicorn main:app --port 5000 --host 0.0.0.0
to list on all interfaces
已回答 1 年前
0
The issue you are describing is not related to Security Groups or NACLs. Your connection would time out (as opposed to being rejected) if it were.
Double check if you are requesting the correct IP (public IP of the EC2 in the public subnet) - you can also test with ip a show
on the ec2 console.
You can try to call your running container from your ec2 to check if the docker network is working as expected.
已回答 1 年前
相關內容
- 已提問 6 個月前
- 已提問 6 個月前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
Thank you @s4zed. I was testing to make api calls from EC2 to my VM. Specifying the
--host
allowed me to make requests from EC2 to my VM. However, making calls from VM to EC2 still throws the same error. There is an image of my security configurations posted at the Stackoverflow question (same questions as here): https://stackoverflow.com/questions/75966975/how-to-open-port-on-ec2-to-allow-api-requests-from-external-ips?noredirect=1#comment133986810_75966975