Search code examples
aws-lambdaaws-api-gateway

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.


Solution

  • 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