Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to instruct an AWS ELB to consider a health check that returns a 403 code as successful?

I have a Jenkins CI server behind in an private EC2 VPC subnet, and in order to make it accessible from the outside world I've set up an ELB (that also handles the HTTPS security certificate using IAM, but that's just the rationale of why I am doing that rather than having a single instance directly accessible).

The Jenkins server is configure to require authentication, so when the ELB is doing its health check as an anonymous user it gets a 403 access forbidden page, which should perfectly fine, but is understood as an error and keeps the instance flagged as out of service.

Is there any way to make the ELB consider a 403 response as an OK response? Or maybe there's a page in Jenkins that always returns a 200 status code?

like image 421
fortran Avatar asked May 15 '14 21:05

fortran


2 Answers

The check you're looking for is /login instead of /

That way you can keep the http check.

like image 157
Federico Avatar answered Nov 16 '22 03:11

Federico


If you are doing an http health check, it does need a 200 response. You can switch this to a tcp health check, which may not be as accurate, but it would not care about the status code.

like image 22
datasage Avatar answered Nov 16 '22 01:11

datasage