Issue while migrating application from ECS to EKS

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

  1. Pod is stable and running
  2. ALB target group is healthy
  3. The application, when run locally [localhost], runs smoothly.
  4. /api/health returns 200
  5. Swagger UI loads HTML but static assets fail, after 3-4 refresh it loads
  6. API endpoints execution returns 502 Bad Gateway
  7. Pod logs show 200 responses whenever endpoints are executed.
  8. 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:

  1. 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
  2. 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
  3. 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!