2 Risposte
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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
con risposta 2 anni fa
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.
con risposta 2 anni fa
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
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