We are using AWS ELB to offload SSL and load balance the incoming traffic. If all instances are down/unhealthy the ELB just sends back a blank page with HTTP status 503.

Is it possible to send a static page, to indicate maintenance, for example?


You have a couple options I can think of:

  1. Put AWS's Cloudfront CDN in front of your ELB, and customize the error response for 503 errors. Details on how to do that are in the AWS docs and it can be done via CLI or the Console.
  2. Use AWS Route53's (or another DNS provider, if they offer something similar) DNS failover to detect when your ELB is down and point DNS at something else like a backup server or an S3 bucket. Details on that are again in the AWS docs.
  • 3
    Or, combine the two and use Route 53 failover to change the record for the origin server that CloudFront connects to, changing from ELB to a bucket (with the same name as the normal origin host), with redirect rules in the bucket to send 403/404 back to /... it sounds a little convoluted but avoids nasty browser caching of DNS, which may make browsers stick to either the ELB or the fallback host until all browser windows are closed. Discovered this the hard way, testing Route 53 failover. CloudFront, by contrast, honors DNS TTLs in the origin server hostname lookup. – Michael - sqlbot Jun 21 '16 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.