Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS API Gateway: Status Code 413, Request Entity too large

I have a server less API with AWS API Gateway and Lambda function. I am using custom authorization function for authorization. The header is too large and due to which I am getting this error. Normally, for an nginx server, I would have changed the nging config and this would have been fixed. I don't know how to take care of this in AWS API Gateway.

like image 725
Mandeep Singh Avatar asked May 26 '16 23:05

Mandeep Singh


2 Answers

The 10MB payload limit applies to the message body. If you're running into limits on the header size, unfortunately these cannot be configured. They are stated on the CloudFront page: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html

In particular:

Custom headers: maximum length of a header name 256 characters

Custom headers: maximum length of a header value 2,048 characters

Custom headers: maximum length of all header values and names combined 10,240 characters

like image 95
jackko Avatar answered Sep 18 '22 08:09

jackko


The limit for payload size currently cannot be changed. From https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html:

10MB payload size, which cannot be changed currently.

If you want more customization, you should run your API on an actual server (e.g. with Amazon EC2).

like image 21
Trapsilo Bumi Avatar answered Sep 19 '22 08:09

Trapsilo Bumi