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.
4eac1f7d1ff86ab17e7a9dbe6af0b44b?d=identicon&s=25 Phillip B Oldham (Guest)
on 2009-02-16 11:40
(Received via mailing list)
Attachment: phill.vcf (262 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
phill@theactivitypeople.co.uk <mailto:phill@theactivitypeople.co.uk>

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

*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.
6057f191e94c033308b1f9359b0e1d2f?d=identicon&s=25 Atif Ghaffar (Guest)
on 2009-02-16 12: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 <
4eac1f7d1ff86ab17e7a9dbe6af0b44b?d=identicon&s=25 Phillip B Oldham (Guest)
on 2009-02-16 13:32
(Received via mailing list)
Attachment: phill.vcf (262 Bytes)
Does that work for all vhosts on the box? or do you have to add it into
each vhost config?

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

--

*Phillip B Oldham*
The Activity People
phill@theactivitypeople.co.uk <mailto:phill@theactivitypeople.co.uk>

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

*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.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-02-16 13:34
(Received via mailing list)
On Mon, Feb 16, 2009 at 12:04:38PM +0100, Atif Ghaffar 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;
}
6057f191e94c033308b1f9359b0e1d2f?d=identicon&s=25 Atif Ghaffar (Guest)
on 2009-02-16 19:48
(Received via mailing list)
igor will try_files also work with 0.6.x?
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 mike (Guest)
on 2009-02-16 20:22
(Received via mailing list)
On Mon, Feb 16, 2009 at 4:23 AM, Igor Sysoev <is@rambler-co.ru> 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.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-02-16 21:06
(Received via mailing list)
On Mon, Feb 16, 2009 at 07:35:15PM +0100, Atif Ghaffar 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.
04ad1ab3d96f873cc3c7a6ccf0328662?d=identicon&s=25 Michael Nachbaur (Guest)
on 2009-02-16 21:08
(Received via mailing list)
On 16-Feb-09, at 3:04 AM, Atif Ghaffar 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.