I am running a Docker container through ECS. The container runs an Apache server hosting a simple web application. However, the server requires LDAP authentication to access the page.
I am using a Service configured with an ELB to manage the distribution across ECS. I am running into a problem where the health check is failing for all instances. From local testing I know that the Docker container/server works.
AWS ELB Health Check docs state that a 200 OK
response is required to pass the health check (my ping path is /index.html
). However, LDAP authentication failure will return 401 Authorization Required
.
How to I get the health check to pass without disabling LDAP?
This question on StackOverflow suggests just switching the health check to a TCP health check, though that doesn't feel right. Happy to do it if it's the correct way to handle this situation.
Best Answer
Do you have an 'unprotected' page? Like a login page?
If so, then you could use this page as the ELB health check.
If not, can you add a simple page (ping.html) which does not require LDAP authentication?