问题
AWS's new Application Load Balancer is throwing an error : 400 Bad Request, Request Header Or Cookie Too Large, awselb/2.0
How do i increase the size in aws-elb. It was working fine with the classic load balancer.
回答1:
we spoken to aws about the same issue, we were sending a header request of a total of 33k, but one of our header ( authorization) size was 30 , but the limit ALB accepts for is as follows : - 16K per request line - 16K per single header - 64K for the entire header
回答2:
This 400 error is being generated by nginx. Now either it's your nginx or AWS ALB is using nginx behind the scenes.
I've encountered and resolved this before with nginx behind ALB by increasing the large_client_header_buffer in our nginx conf to 4 512k. If you have calculated the max size of your uri or cookies and it's within your large_client_header_buffer size then you'll have to raise a support ticket with AWS.
来源:https://stackoverflow.com/questions/39145349/aws-application-load-balancer-request-header-or-cookie-too-large