Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"502 bad gateway" - 1MB limit static page served from AWS Lambda to Application Load Balancer

When accessing our static webpage hosted on an ALB served by a Lambda, we get a 502 bad gateway error. In the ALB logs, we can see that the error is that our Lambda response is larger than 1MB. We want to continue using an Application Load Balancer for our webpage, and need to find some way around this 1MB limit (can we deploy our code such that the Lambda returns multiple separate <1MB chunks of JS code?)

We looked online at other SO questions, and have found only a couple with people running into our issue, but no solutions provided. The AWS docs document this limitation, but again, no solutions are provided.

like image 455
Zachary Steudel Avatar asked Aug 08 '19 16:08

Zachary Steudel


1 Answers

We ended up deciding to switch off of the ALB and move to API Gateway. API Gateway can handle a 6MB return from a Lambda, so this should be fine for our purposes.

like image 70
Zachary Steudel Avatar answered Sep 28 '22 08:09

Zachary Steudel