Выставлять connection close

Kirill A. Korinskiy catap+nginx at catap.ru
Fri May 15 23:39:55 MSD 2009


At Fri, 15 May 2009 22:42:56 +0400,
Igor Sysoev <is at rambler-co.ru> wrote:
> 
> On Fri, May 15, 2009 at 10:31:16PM +0400, Kirill A. Korinskiy wrote:
> 
> > At Fri, 15 May 2009 21:45:09 +0400,
> > Igor Sysoev <is at rambler-co.ru> wrote:
> > > 
> > > Я вот не могу вспомнить сайты, выдающие 204.
> > > Чего нельзя сказать про 304.
> > > 
> > 
> > я тут подумал, меня вполне удовлетворит такой вот патч
> > 
> > diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c
> > index 332fceb..6bf2fc4 100644
> > --- a/src/http/ngx_http_header_filter_module.c
> > +++ b/src/http/ngx_http_header_filter_module.c
> > @@ -226,7 +226,7 @@ ngx_http_header_filter(ngx_http_request_t *r)
> >                  r->headers_out.last_modified_time = -1;
> >                  r->headers_out.last_modified = NULL;
> >                  r->headers_out.content_length = NULL;
> > -                r->headers_out.content_length_n = -1;
> > +                r->headers_out.content_length_n = 0;
> >              }
> >  
> >              status -= NGX_HTTP_OK;
> 
> rfc2616:
> 
> 10.2.5 204 No Content
> 
>    ...
> 
>    The 204 response MUST NOT include a message-body, and thus is always
>    terminated by the first empty line after the header fields.
> 

ага, только там не говорится что не надо при этом ставить
Content-length в 0 при keep-alive

-- 
wbr, Kirill





More information about the nginx-ru mailing list