how can i quickly handle alternate config for site downtime?

Ezra Zygmuntowicz ezmobius at
Sun Dec 28 22:58:02 MSK 2008

On Dec 28, 2008, at 9:23 AM, Jonathan Vanasco wrote:

> On Dec 26, 2008, at 4:59 PM, Corey Donohoe wrote:
>> Is this other config file pointing tosome kind of status page that
>> says " is down right now!" or something similar?  If it
>> is, you prolly wanna investigate maintenance pages and have them
>> return 503s during the downtime.
> hmm....  that could work.
> would you be able to share those 2 snippets you listed as a pastie  
> again ?  they expired ( as did your old link at 
>  )
> also - just to be sure about this... you're triggering a downtime  
> response just by a file-existence check, right?


	Yeah we are triggering a maintenance page via the existance of a  
file. Here is how it looks in the config file.

# Rewrite all the requests to the maintenance.html page if it exists.
if (-f $document_root/system/maintenance.html) {
   return 503;

error_page 503 @503;
location @503 {
   rewrite  ^(.*)$  /system/maintenance.html break;

	This means that if $document_root/system/maintenance.html exists,  
then only serve that file and nothing else for every request.

Ezra Zygmuntowicz
ez at

More information about the nginx mailing list