diff --git a/services/web/app/src/Features/Errors/HttpErrorHandler.js b/services/web/app/src/Features/Errors/HttpErrorHandler.js index c440239ad6..a3fcb40956 100644 --- a/services/web/app/src/Features/Errors/HttpErrorHandler.js +++ b/services/web/app/src/Features/Errors/HttpErrorHandler.js @@ -139,7 +139,12 @@ module.exports = HttpErrorHandler = { }, maintenance(req, res) { - res.status(503) + // load balancer health checks require a success response for / + if (req.url === '/') { + res.status(200) + } else { + res.status(503) + } let message = `${Settings.appName} is currently down for maintenance.` if (Settings.statusPageUrl) { message += ` Please check https://${Settings.statusPageUrl} for updates.` diff --git a/services/web/test/acceptance/src/CloseSiteTests.js b/services/web/test/acceptance/src/CloseSiteTests.js index 33854e8b94..fa459b1ce1 100644 --- a/services/web/test/acceptance/src/CloseSiteTests.js +++ b/services/web/test/acceptance/src/CloseSiteTests.js @@ -49,5 +49,19 @@ describe('siteIsOpen', function() { done() }) }) + + it('should return a 200 on / for load balancer health checks', function(done) { + request.get('/', (error, response, body) => { + response.statusCode.should.equal(200) + done() + }) + }) + + it('should return a 200 on /status for readiness checks', function(done) { + request.get('/status', (error, response, body) => { + response.statusCode.should.equal(200) + done() + }) + }) }) })