Multiple Maintenance Pages

Davy Campano dcampano at gmail.com
Tue Jun 17 04:40:00 MSD 2008


I've looked around for this but haven't come across the answer.  I am
wondering if it is possible to have a maintenance page be displayed for one
subdirectory but not the other.

I have 2 apps on same machine with a root of /public_html/
App 1 is /public_html/app1/
App 2 is /public_html/app2/

I want the maintenance page to be shown for app 1 only when it exists in the
app 1 subdirectory.

This looks like it would show it for both applications:

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

Is there a way to rewrite only the requests for a certain directory without
making manual changes like this:

if (-f $document_root/app1/maintenance.html) {
  rewrite  ^(.*)$  /app1/maintenance.html last;
  break;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080616/c2fa57aa/attachment.html>


More information about the nginx mailing list