2 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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
beantwortet vor 2 Jahren
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.
beantwortet vor 2 Jahren
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Monat
- AWS OFFICIALAktualisiert vor 8 Monaten
- AWS OFFICIALAktualisiert vor einem Monat
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