I'm using nginx with capistrano to deploy my Rails app and I'm having
a hard time getting the maintenance capistrano task
(deploy:web:disable) to work like I want. I want nginx to redirect all
requests to public/maintenance-on.html if the file exists, however,
since I use stylesheets and images on this file, nginx should serve
them. Here's what I have so far on nginx.conf:
if (-f $document_root/public/maintenance-on.html) {
rewrite ^(.*)$ /maintenance-on.html last;
break;
}
How could I make this not match urls containing /stylesheets/ and /
images/?
Thanks, working on the regexp would probably work. In this case it
almost worked, the maintenance is displayed on the index, and the
images work, but other internal pages still show up.