Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in AWS by (19.1k points)

I'm using AWS Load Balancer with 3 EC2 servers, and I'm trying to serve a Maintenance page when the site is under maintenance.

This page needs to return 503 HTTP code because it is a proper code for a maintenance mode and will prevent possible problems with SEO.

When I return 503 code from any of my servers, Load Balancer makes it "Not In Service", and when all servers return 503, the website returns a blank page (because all servers are disconnected).

My questions are:

1) Is there any way to serve a custom static page with a message for visitors from Load balancer if there are no healthy servers?

2) Or how to configure Load Balancer's Health Check that it will not consider 503 as a reason to mark the server as "unhealthy"?

1 Answer

0 votes
by (44.4k points)

In your application server, add an additional route for the health check maintenance. Let us keep it as /heal, so whenever you want to go into maintenance mode so that /heal will return 200 OK instead of / (root) or /index.html. Because both the paths will return 503 Service Unavailable. After maintenance, you can revert the changes.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
asked Jul 13, 2019 in AWS by yuvraj (19.1k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...