title: nginx maintenance page with content issue
body: <p>To show maintenance page during deploy I've always used next config in nginx:</p>
  
  <pre><code>if (-f /home/shared/system/maintenance.html) {
      return 503;
  }
  
  error_page 503 @maintenance;
  
  location @maintenance {
      root /home/shared/errors;
      rewrite ^(.*)$ /maintenance.html break;
  }
  </code></pre>
  
  <p>And everything was ok until I needed to add static content to maintenance page (images, stylesheets, etc.)</p>
  
  <p>No of static content work with such logs in error.log:</p>
  
  <pre><code>2011/05/05 02:47:20 [notice] 13760#0: *6 "^(.*)$" matches "/some.jpg", client: x.x.x.x, server: server.com, request: "GET /some.jpg HTTP/1.1", host: "server.com"
  2011/05/05 02:47:20 [notice] 13760#0: *6 rewritten data: "/maintenance.html", args: "", client: x.x.x.x, server: server.com, request: "GET /some.jpg 2 HTTP/1.1", host: "server.com"
  </code></pre>
  
  <p>Which is logical - if I do rewrite everything to maintenance.html that means that static content is not exclusion.</p>
  
  <p>But I cannot find any proper solution to make redirect to every file except that ones which are physically existed in <code>root /home/shared/errors</code> folder.</p>
  
  <p>PS. <code>/home/shared/errors</code> does not share any resources with common project folder - this is completely separate folder (even without any symlinks to <code>/current</code> for the project.</p>