Aws-elb health check failing at 302 code

I stuck with the same problem in AWS ALB (Health checks failed with these codes: [302]) Configuration:

  • Tomcat 9 servers that are listening on port 80 only
  • ALB health check path was set to "/my_app_name" expecting to serve health check from the application's root index page.

My configured health page is not expected to do any redirects, but to return HTTP/200 if server is healthy and HTTP/500 if unhealthy.

The proposed solution just to add HTTP/302 as a success code is absolutely WRONG and misleading. It means that the page's internal health check logic isn't run, as HTTP/302 redirect code just shows common ability of the server to respond.

The problem was in Tomcat server itself that in the case of request to "/my_app_name" was redirecting with HTTP/302 to "/my_app_name/" (pay attention to the slash at the end).

So setting health check path to "/my_app_name/" fixed the problem, health check logic runs well and HTTP/200 is returned.


you get 302 when performing URL redirection, any ELB Health check will look for success code 200 for the health check to pass. In ALB, this can be configured under health check in the ELB console.

To modify the health check settings of a target group using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. On the navigation pane, under LOAD BALANCING, choose Target Groups. Select the target group.
  3. On the Health checks tab, choose Edit.
  4. On the Edit target group page, modify the setting Success Codes to 302 or as needed, and then choose Save.

enter image description here