root: Make health checks compatible with cloud platform load balancers (#10554)

* Change health checks to return HTTP 200.

* Fix web.go check.

* Only update docs.

* update docs and add changelog entry

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Mike Fotinakis
2024-07-20 15:15:29 -04:00
committed by GitHub
parent f24d508734
commit fd1d252d44
5 changed files with 58 additions and 8 deletions

View File

@ -89,7 +89,7 @@ func NewWebServer() *WebServer {
}
req.Header.Set("User-Agent", "goauthentik.io/router/healthcheck")
res, err := ws.upstreamHttpClient().Do(req)
if err == nil && res.StatusCode == 204 {
if err == nil && res.StatusCode >= 200 && res.StatusCode < 300 {
return true
}
return false