aws load balancer with no health check? or make it work with non-200 response?

Jay picture Jay · May 28, 2014 · Viewed 15.1k times · Source

I have a site I am trying to attach to a load balancer that requires Basic Authentication. It fails the health check. I'm guessing this is because instead of returning a 200 it's returning a 401.

Similarly, I have another site that is trying to do a redirect. So instead of returning a 200 it's returning a 302. And again, this is treated as a failure by the health check. (Why do I want to have a load balancer in front of something that just redirects? Because of goofy client requirements, that's why!)

I don't see any way to just disable the health check, or to tell the health checker to accept a response other than a 200, or to tell it to supply authentication credentials, or ... any way around either of these problems.

Answer

Julio Faerman picture Julio Faerman · May 28, 2014

Two alternatives:

  • Configure a specific url for the health check, one that only sends non-200 responses when the service is really having problems (e.b. no database connection).

  • Change the Ping Protocol to TCP in the ELB configuration. That way it will only check for a sucessful tcp connection and not perform an http request.