ngx_http_send_special_response
hagai avrahami
hagaizzz at yahoo.com
Mon Apr 16 16:28:01 UTC 2012
Thanks!
>________________________________
> From: Maxim Dounin <mdounin at mdounin.ru>
>To: nginx at nginx.org
>Sent: Monday, April 16, 2012 6:57 PM
>Subject: Re: ngx_http_send_special_response
>
>Hello!
>
>On Mon, Apr 16, 2012 at 08:14:25AM -0700, hagai avrahami wrote:
>
>> Hi
>> Thanks
>>
>> The redirect response is from content handler context.
>>
>> Using the code you added
>>
>> cause Nginx to send back the Error Page (302) with
>> Content-Length and Content-Type ("test/html") (And I am trying
>> avoid that) without Body
>
>Ah, sorry, I missed you want to send 302 with an empty body, not
>just 302. Then instead of
>
> return NGX_HTTP_MOVED_TEMPORARY;
>
>you have to send actual response youself, like this:
>
> r->headers_out.status = NGX_HTTP_MOVED_TEMPORARY;
> r->headers_out.content_length_n = 0;
>
> rc = ngx_http_send_header(r);
>
> if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
> return rc;
> }
>
> return ngx_http_send_special(r, NGX_HTTP_LAST);
>
>Maxim Dounin
>
>_______________________________________________
>nginx mailing list
>nginx at nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120416/e8f17f9d/attachment-0001.html>
More information about the nginx
mailing list