Forum: NGINX "down for maintenance" plugin?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Phillip B Oldham (Guest)
on 2009-02-16 12:40
(Received via mailing list)
Attachment: phill.vcf (0 Bytes)
I seem to remember there was a plugin for nginx would bypass all
requests and issue a single "down for maintenance" response, until a
certain file was removed/renamed.

I can't find it on the wiki though. Was I imagining the plugin?
--

*Phillip B Oldham*
The Activity People
removed_email_address@domain.invalid 
<mailto:removed_email_address@domain.invalid>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to
anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.
Atif G. (Guest)
on 2009-02-16 13:12
(Received via mailing list)
We use this in the server section

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

On Mon, Feb 16, 2009 at 11:30 AM, Phillip B Oldham <
Phillip B Oldham (Guest)
on 2009-02-16 14:32
(Received via mailing list)
Attachment: phill.vcf (0 Bytes)
Does that work for all vhosts on the box? or do you have to add it into
each vhost config?

Atif G. wrote:
>
>
>     This e-mail has been created in the knowledge that Internet e-mail
>
>
> --
> best regards
> Atif G.

--

*Phillip B Oldham*
The Activity People
removed_email_address@domain.invalid 
<mailto:removed_email_address@domain.invalid>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to
anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.
Igor S. (Guest)
on 2009-02-16 14:34
(Received via mailing list)
On Mon, Feb 16, 2009 at 12:04:38PM +0100, Atif G. wrote:

> We use this in the server section
>
>   if (-f /srv/www/maintenance.html) {
>                 rewrite ^/(.*)$ /maintenance.html last;
>                 break;
>             }

location / {
    try_files      /maintenance.html
                   $uri  $uri/index.html  $uri.html
                   @mongrel;
}

location @mongrel {
    proxy_pass     http://mongrel;
}
Atif G. (Guest)
on 2009-02-16 20:48
(Received via mailing list)
igor will try_files also work with 0.6.x?
mike (Guest)
on 2009-02-16 21:22
(Received via mailing list)
On Mon, Feb 16, 2009 at 4:23 AM, Igor S. <removed_email_address@domain.invalid> 
wrote:

>>   if (-f /srv/www/maintenance.html) {
>>                 rewrite ^/(.*)$ /maintenance.html last;
>>                 break;
>>             }
>
> location / {
>    try_files      /maintenance.html
>                   $uri  $uri/index.html  $uri.html
>                   @mongrel;
> }

this is cool but i like #1 better...

you could make a single file enable maintenance mode for -all-
websites on the server.
Igor S. (Guest)
on 2009-02-16 22:06
(Received via mailing list)
On Mon, Feb 16, 2009 at 07:35:15PM +0100, Atif G. wrote:

> igor will try_files also work with 0.6.x?

There is a patch:
http://sysoev.ru/nginx/patch.try_files.0.6.35.1

I plan to add it in 0.6.x after some 0.7.x releases.
Michael Nachbaur (Guest)
on 2009-02-16 22:08
(Received via mailing list)
On 16-Feb-09, at 3:04 AM, Atif G. wrote:

> We use this in the server section
>
>   if (-f /srv/www/maintenance.html) {
>                 rewrite ^/(.*)$ /maintenance.html last;
>                 break;
>             }

What I use is the following:
     location / {
         fastcgi_pass             unix:/tmp/fcgi.socket;
         include                  /etc/nginx/fastcgi_params;
     }
     error_page   502 /maint.html;

My entire site is served from a FastCGI process, so when it's down or
is restarting, any requests get sent to maint.html.  502 is only
thrown when nginx can't access the back-end gateway (either FastCGI or
a proxy), so your maintenance page will only be shown when you're
actually doing maintenance.
This topic is locked and can not be replied to.