When doing health check in AWS application load balancer, I need set health check to path /service_name/health
But it also need be accessed with api key (a header)
How can I implement this type of health check?
Unfortunately, there is no direct way of doing this, without a proxy. ALB only supports GET for heath checks.
A workaround is to set status code to 403 (or whatever is returned from your service on failed authentication) instead of 200. This usually works since if the service responds with expected failed authentication code (e.g. 403) you can assume that the application is working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With