9

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.

Kechit Goyal
  • 3,002
  • 2
  • 16
  • 19
  • You might have to open a ticket with AWS support regarding this issue. – Mark B Aug 25 '16 at 13:41
  • Could you check that it is not the web server itself generating that error and passing it to the ELB? 400 level errors are most likely being generated by the web server and not the ELB eg 404 etc. – Rodrigo M Aug 25 '16 at 15:15
  • We have nginx behind the elb. I have tried increasing the large_client_header_buffers in nginx. Plus there are no error logs or access logs on nginx when I get this error. – Kechit Goyal Aug 26 '16 at 03:28

2 Answers2

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

0

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.

NHol
  • 1,866
  • 11
  • 24