How do you put up a maintenance page for AWS when your instances are behind an ELB?

后端 未结 6 1464
滥情空心
滥情空心 2021-01-30 16:32

How do you put up a maintenance page in AWS when you want to deploy new versions of your application behind an ELB? We want to have the ELB route traffic to the maintenance inst

6条回答
  •  青春惊慌失措
    2021-01-30 17:01

    I realise this is an old question but after facing the same problem today (December 2018), it looks like there is another way to solve this problem.

    Earlier this year, AWS introduced support for redirects and fixed responses to Application Load Balancers. In a nutshell:

    • Locate your ELB in the console.
    • View the rules for the appropriate listener.
    • Add a fixed 503 response rule for your application's host name.
    • Optionally provide a text/plain or text/html response (i.e. your maintenance page HTML).
    • Save changes.

    Once the rule propagates to the ELB (took ~30 seconds for me), when you try to visit your host in your browser, you'll be shown the 503 maintenance page.

    When your deployment completes, simply remove the rule you added.

提交回复
热议问题