Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

amazon load balancer returns error code 400

We have a load balancer on amazon which balance 4 servers. When sending specific HTTP request to the load balancer I get Http error code 400. But when I sends the same request to each one of the servers directly I get Http 200 OK. Other requests are working fine when using the balancer.

Any Ideas?

Thanks.

like image 689
Liad Avatar asked Jan 09 '13 18:01

Liad


People also ask

How do I troubleshoot 504 errors returned while using an application load balancer?

When the backend instance closes a TCP connection to the load balancer before it reaches its idle timeout value, an HTTP 504 error might display. To resolve this, activate keep-alive settings on your backend instances, and then set the keep-alive timeout to a value greater than the load balancer's idle timeout.

What causes ELB 4XX?

ELB 4XX errors HTTP 4XX error codes are generated when clients send faulty or malformed requests to the load balancer. Though potential causes for these errors can be guessed, not much can be done to troubleshoot.


2 Answers

Don't know if this will help you, but I've had a similar problem. I was using jMeter and when accessing my instance over AWS load balancer I would always get: HTTP/1.1 400 BAD_REQUEST. After lot of debugging I found out that I was sending an empty header (no name and no value) because I had an empty row in HTTP Header Manager in jMeter. So, I persume, AWS ELB does some headers checking, and returns HTTP 400, even tough I wasn't having any problems with going with the same request to my instances directly. I don't know if this will help you but you should double-check your headers for some stupid mistake like this one :D

like image 88
MoD Avatar answered Nov 04 '22 21:11

MoD


I had a similar problem to this, and it was caused by ALB not accepting HTTP methods that are in lower case.

GET http://myhost.com/foo -> HTTP 200
get http://myhost.com/foo -> HTTP 400
like image 29
Martin Costello Avatar answered Nov 04 '22 23:11

Martin Costello