API Gateway returns 500 when proxying to ALB on port 80
criticalconfigurationUpdated Oct 16, 2024(via Exa)
Technologies:
How to detect:
When LocalStack API Gateway attempts to proxy requests to a LocalStack Application Load Balancer using port 80, requests fail with HTTP 500 'Internal Server Error'. This occurs because LocalStack does not listen on port 80 by default, resulting in ConnectionRefused errors when API Gateway tries to reach the ALB endpoint.
Recommended action:
Configure LocalStack to listen on ports 80 and 443 in addition to the default 4566 by setting the environment variable GATEWAY_LISTEN=:4566,:80,:443 in docker-compose.yml or container configuration. Alternatively, use port 4566 in the ALB baseurl or route through an external proxy like ngrok as a workaround.