Hii all,
I am facing an issue with a NodeJS application deployed on Amazon EKS (Fargate) and exposed using AWS ALB Ingress Controller.
The same container image works correctly on ECS, but on EKS the application behaves inconsistently.
Architecture
EKS (Fargate)
ALB Ingress Controller
ALB → CloudFront → Cloudflare (DNS only)
Pod networking: Fargate
Application: NodeJS with Swagger
Service type: ClusterIP
Ingress type: ALB
Issue Summary
- Pod is stable and running
- ALB target group is healthy
- The application, when run locally [localhost], runs smoothly.
- /api/health returns 200
- Swagger UI loads HTML but static assets fail, after 3-4 refresh it loads
- API endpoints execution returns 502 Bad Gateway
- Pod logs show 200 responses whenever endpoints are executed.
- Port-forwarding also does not work and behaves the same as ALB.
Observed Errors
Swagger UI:
Browser console error:
Failed to load resource: the server responded with a status of 502 ()
swagger-ui.css:1
NOTE: It works after 3-4 refresh.
API Endpoint Execution:
Calling an API endpoint via Swagger or curl returns:
Error: response status is 502
But application logs on argocd show:
200 status code
Question:
- Why does ALB Ingress returns 502 for static assets (e.g. /api/swagger-ui-bundle.js) even though:
Pod is healthy
Target group is healthy
Ingress paths are correctly configured - Whether there are known limitations or requirements for:
Serving static assets via ALB Ingress on EKS Fargate
NestJS / Node.js apps behind ALB with path-based routing - Confirmation if additional ALB annotations or settings are required for:
HTTP/2 handling
Static asset responses
Large JS bundles
Connection reuse / timeouts
Thanks in advance to all!