I have a web server (Windows/IIS) hosting various web applications running as a VM on Azure.
Now, I'll need to do some maintenance on the web server, which will involve shutting down and reconfiguring the VM. During this downtime (which should be short, but could be longer if anything unexpected happens), clients accessing the web applications will run into a timeout, which is not very user-friendly. Instead, I'd like them to see a nice "This server is undergoing maintenance, please try again in a few minutes" message.
The best idea I could come up so far would be to:
- Create a second VM with a web server (maybe a simple Linux machine, so that I can store and keep the web server config file for the next time I need this), serving only the static maintenance message for all requests.
- Attach the external IP of our production VM to this "maintenance notice VM".
- Do the maintenance.
- Attach the external IP of our production VM back to the production VM.
Step 1 seems like a lot of work to set up (especially since all sites use HTTPS), so I'm wondering if there's an easier way that I'm missing.
Related questions I've found:
- Easiest way to show Maintenance page during EC2 instance down time - This is about AWS rather than Azure, and it was written at a time when "HTTPS by default" wasn't a big thing yet, so you didn't have to worry about a bunch of per-site SSL certificates.
- Temporarily redirect *all* HTTP/HTTPS requests in IIS to a "server maintenance" page - This is about a situation where the web server itself stays online.