How to get mongrel to use maintenance.html file?

Does someone know how to tell mongrel_rails to read the
public/system/maintenance.html file?

You’d probably ask Apache / ngnix to do that, actually, via some
mod_rewrite-fu I can’t muster this morning :confused:

Cheers,
-Nate

On Mon, Mar 31, 2008 at 10:34 AM, Nate V. [email protected] wrote:

You’d probably ask Apache / ngnix to do that, actually, via some
mod_rewrite-fu I can’t muster this morning :confused:

Cheers,
-Nate

On Mon, Mar 31, 2008 at 11:28 AM, James T. [email protected] wrote:

Does someone know how to tell mongrel_rails to read the
public/system/maintenance.html file?

Generally, yes.

If you are doing some sort of maintenance, you probably want that
served at the highest level possible. i.e. at the web server level.

Swiftiply w/ rewrite support (totally experimental, but will probably
end up in a release soon)

:rewrites:

  • :match: “*”
    :sub: “/public/system/maintenance.html”

Apache:

RewriteEngine On
RewriteRule * /public/system/maintenance.html
(or something similar; unless you do it a lot, always check the
rewrite rule docs when writing them)

Kirk H.

For nginx, try something like this,

error_page 503 /maintenance.html;

location /maintenance.html {

}

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

if (!-f $request_filename) {
   rewrite ^(.+)$ $uri break;
   proxy_pass http://mongrel_app;

}
}

This is slightly different to the configuration that is out there for
doing /maintenance.html because those return a 200 code in maintenance
mode, which upsets paypal

Cheers

Dave