Maintenance message pages
Igor Sysoev
is at rambler-co.ru
Tue Aug 7 00:55:45 MSD 2007
On Mon, Aug 06, 2007 at 07:10:16PM +0200, Alexander Staubo wrote:
> On 8/6/07, Roxis <roxis at list.ru> wrote:
> > On Monday 06 August 2007, Alexander Staubo wrote:
> > > is there any way I can check for the presence of an HTTP
> > > header in an "if" expression?
> >
> > $http_header_name ?
>
> That's pretty much undocumented, but it works, thanks. Now since Nginx
> does not do boolean logic expressions, I am left with two blocks that
> cannot be combined:
>
> if ($http_X_Requested_With ~ XMLHttpRequest) {
> rewrite /.*/ /maintenance_ajax.html last;
> return 200;
> }
>
> and
>
> if (-f $document_root/.maintenance) {
> return 503;
> }
>
> Ideally, the first line should say:
>
> if (-f $document_root/.maintenance && $http_X_Requested_With ~
> XMLHttpRequest) {
Why do you test AJAX using header ?
Can AJAX request separate URI ?
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list