1 Answer
- Newest
- Most votes
- Most comments
0
The issue you are seeing is likely due to how API Gateway handles static assets like images, JavaScript files etc differently than an Application Load Balancer.
When you make a request through API Gateway, it does not proxy the entire request to the backend. It handles the integration with the backend separately.
Check these:
- Make sure the backend Application Load Balancer is configured as a proxy integration in API Gateway. This will pass the entire request to the ALB.
- Check that the security groups allow traffic from API Gateway to the ALB on the necessary ports.
- As a workaround, you can host the static assets on S3 or CloudFront and update the URLs in your HTML/JS files to point to the S3/CloudFront endpoint instead of going through API Gateway.
- Consider using API Gateway private integrations if your backend is private. This allows private connectivity without going through a public endpoint.
Relevant content
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a month ago