"down for maintenance" plugin?

Michael Nachbaur mike at nachbaur.com
Mon Feb 16 22:59:14 MSK 2009

On 16-Feb-09, at 3:04 AM, Atif Ghaffar wrote:

> We use this in the server section
>   if (-f /srv/www/maintenance.html) {
>                 rewrite ^/(.*)$ /maintenance.html last;
>                 break;
>             }

What I use is the following:
     location / {
         fastcgi_pass             unix:/tmp/fcgi.socket;
         include                  /etc/nginx/fastcgi_params;
     error_page   502 /maint.html;

My entire site is served from a FastCGI process, so when it's down or  
is restarting, any requests get sent to maint.html.  502 is only  
thrown when nginx can't access the back-end gateway (either FastCGI or  
a proxy), so your maintenance page will only be shown when you're  
actually doing maintenance.

More information about the nginx mailing list