I\'m using AWS Load Balancer with 3 EC2 servers, and I\'m trying to serve a Maintenance page when site is under maintenance.
This page need to return 503 HTTP code, bec
The load balancer will serve a 503
for you when you no longer have any healthy server behind it so you should not do anything special.
If you return anything but a 200
on the health check, ELB will take the machine out of the load balancer after it fails the configured number of health checks.
So to recap, you can potentially serve 503
from your app when in maintenance, but you have to return 200
for health checks all the time. If you don't care about the content of the page, you can simply remove the machines from the load balancer (or fail health checks) and the LB will do the right thing for you.