I have Frontend(React) and Backend(Fast-API) containers running on ECS in the same Private Subnet. Following my Github Repository
https://github.com/TakehikoEsaka/odekakekun
The Frontend is connected to an ALB, while the Backend is not directly connected. Instead, the Backend has Service Discovery configured.
Checked
- When I execute curl
http://backend-servicediscovery.namespace/api/sample-api
from the Frontend container, I receive a response. I can see logs indicating that the Backend API was accessed successfully.
Issue
- However, when I try to access
http://backend-servicediscovery.namespace/api/sample-api
from the browser, I receive the following error in the browser console:
GET http://backend-servicediscovery.namespace/api/sample-api net::ERR_NAME_NOT_RESOLVED"
- Based on the error, it seems like name resolution is failing. Additionally, there are no access logs in the Backend container, suggesting that the API is not being accessed.
Question
- I have looked into Proxy and CORS but couldn't find detailed information. Could you please provide guidance on how to make the Backend API accessible from the browser?
Best Regards