We're going to have to temporarily shutdown our servers, as they need to be physically moved and put onto a better UPS.
I don't want to just have "can't connect" errors come up for our users, and I have another smaller server box that I thought could display a "maintenance mode" message.
Reassure them that this is scheduled maintenance - so they're not panicked that we've disappeared or anything - give them a time for when everything will be back up, apologise for the inconvenience. That sort of thing.
For HTTP, this is easy to set up. I create the "maintenance mode" HTML page and then have it that the default virtualhost - the catch all - shows this page upon any request made to the server.
So that any HTTP links to any of the virtual hosts on our servers will match this and show the temporary "service unavailable" message.
But HTTPS has me a little stumped, because the host name has to match the SSL certificate to avoid the browser throwing up security warnings.
What I want is a default SSL "catch all" that'll match any host name - because none of the virtual hosts are actually up on this temporary server - and then redirect to the HTTP maintenance message.
I gave this a go:
<VirtualHost *:443>
ServerName catch-all
ServerAlias *
RedirectMatch ^(.*)$ http://%{SERVER_NAME}/
</VirtualHost>
But I'm getting "the site can't provide a secure connection" in Chrome (ERR_SSL_PROTOCOL_ERROR) and curl is complaining about "ssl wrong version".
I need it so that if someone follows a HTTPS link to something on our servers, it's all redirected to the HTTP "maintenance" page.
Can a server "cancel" the SSL handshake and redirect to HTTP like this?