apachefastcgimod-fastcgi

How can I show a maintenance page when my FastCGI app is restarting?


I am serving my FastCGI application in Apache2 using the standalone FastCGI server and the FastCgiExternalServer directive.

When I restart my FastCGI app my users get a 500 error. What can I do to prevent this? I want to show them a nice 'maintenance' page or something.

It is a Catalyst application written in perl and I have followed the example here but I have found that a 500 is served and not a 502 bad gateway so I can't select what error to show. I don't want to serve a maintenance page for a legitimate internal server error.


Solution

  • Your only real choices are

    1. Use ErrorDocument 500 and design a page that's suitable for either situation, or
    2. Hack/fix mod_fastcgi to return a 502 instead of a 500 like the folk wisdom thinks it should.

    mod_fastcgi development is very slow, but not completely dead, so you could always try sending that patch upstream; if it was accepted it would be appreciated. :)