the code is as the following:
header->hash = 1;
header->key.len = sizeof(“Location”) - 1;
header->key.data=(u_char ) “Location”;
header->value.len = strlen(param->redirectUrl);
header->value.data=(u_char)param->redirectUrl;
r->header_only=1;
r->headers_out.content_length_n=0;
r->headers_out.content_type.len = sizeof(“text/html”) - 1;
r->headers_out.content_type.data = (u_char *) “text/html”;
r->headers_out.status = NGX_HTTP_OK;
return NGX_HTTP_MOVED_TEMPORARILY;
when using keepalive (65s),the http responce will return in more than
65s .
I use two methods
- if I send some contents back(so r->header_only=0),the phenomena is
gone,the http responce return normally. - If I set r->keepalive=0,the phenomena is also gone,the http responce
return normally.
Are the above methods right?
thanks
Posted at Nginx Forum: