Forum: Ruby on Rails Help with capistrano and nginx

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B2896675ee61d866e6a5a19407730602?d=identicon&s=25 (Guest)
on 2007-07-01 07:23
(Received via mailing list)
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;

How could I make this not match urls containing /stylesheets/ and /

Thanks in advance
4c3acdc3d93f54cc7a7281780ec8a4ee?d=identicon&s=25 Shai Rosenfeld (shai)
on 2007-07-01 09:44
this question would probably be best answered on the deployment forum.
here u go:
B2896675ee61d866e6a5a19407730602?d=identicon&s=25 (Guest)
on 2007-07-02 08:49
(Received via mailing list)
Thanks, but the group seems kinda dead. None else has a similar

On Jul 1, 4:44 am, Shai Rosenfeld <>
A39970d780c506b26e9a8b71eda13df2?d=identicon&s=25 Walter McGinnis (Guest)
on 2007-07-02 10:42
(Received via mailing list)
Not sure if this helps at all, but taking a shot in the dark (I didn't
your original post):

B2896675ee61d866e6a5a19407730602?d=identicon&s=25 (Guest)
on 2007-07-02 12:07
(Received via mailing list)
Not really what I'm looking for. I'm starting to think there's no way
to do this, hasn't anybody ever wanted to add images to their
maintenance pages?

On Jul 2, 5:41 am, "Walter McGinnis" <>
4c3acdc3d93f54cc7a7281780ec8a4ee?d=identicon&s=25 Shai Rosenfeld (shai)
on 2007-07-02 13:22
> How could I make this not match urls containing /stylesheets/ and /
> images/?

will modifiying the matching regexp work?

> if (-f $document_root/public/maintenance-on.html) {
   instead of
>   rewrite ^(.*)$ /maintenance-on.html last;

   rewrite ^([^(stylesheets|images)]*)$

>   break;
> }

or something like that...
B2896675ee61d866e6a5a19407730602?d=identicon&s=25 (Guest)
on 2007-07-02 22:48
(Received via mailing list)
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.

Any ideas?

On Jul 2, 8:22 am, Shai Rosenfeld <>
This topic is locked and can not be replied to.