Maintenance mode

From: Alexander Staubo <alex#bengler.no>
Date: Mon, 16 Jun 2008 21:37:13 +0200


With Nginx there is a simply trick to put a site in maintenance mode, rewriting every request to show a temporary page that says something like, "We're upgrading, please wait."

To do this, one simply checks for a local file, maps 503 to a custom error file and returns it:

  if (-f $document_root/.maintenance_mode) {     error_page 503 /maintenance.html;
    return 503;
  }

Is there a way to achieve the same effect in HAProxy -- *without* writing a new configuration file and then reloading HAProxy? For example, it would be nice if HAProxy had an ACL expression to check a file:

  acl maintenance file_exists(/app/foo/.maintenance)

But even with such an ACL, I don't see a way to serve a specific file; I guess would have to rewrite the request path and send the request to a web server backend.

Alexander Received on 2008/06/16 21:37

This archive was generated by hypermail 2.2.0 : 2008/06/16 21:45 CEST