Hi,

the usual Rails configs I've seen floating around for nginx handle
maintenance messages something like this:

if (-f $document_root/system/maintenance.html) {
  rewrite  ^(.*)$  /system/maintenance.html last;
  break;
}

I've not actually managed to make this work properly but this is
actually bad in another way.  It returns the maintenance message with a
http code 200.

Users visiting the site see a maintenance message and wait or go away or
click reload repeatedly.  Search engines will see the http code 200 and
assume this is the new page content and index and cache it!

No need to cry over spilt Google juice though, this works better:

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

location = /system/maintenance.html {
 root   /path/to/your/webroot;
}

We use 503 because rfc2616 tells us we should.

Hopefully your maintenance period isn't long enough for this to matter,
but still :)

John.
--
Brightbox UK Rails Hosting
http://www.brightbox.co.uk




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to