<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thanks!<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Maxim Dounin <mdounin@mdounin.ru><br> <b><span style="font-weight: bold;">To:</span></b> nginx@nginx.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, April 16, 2012 6:57 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: ngx_http_send_special_response<br> </font> </div> <br>
Hello!<br><br>On Mon, Apr 16, 2012 at 08:14:25AM -0700, hagai avrahami wrote:<br><br>> Hi<br>> Thanks<br>> <br>> The redirect response is from content handler context.<br>> <br>> Using the code you added <br>> <br>> cause Nginx to send back the Error Page (302) with <br>> Content-Length and Content-Type ("test/html") (And I am trying <br>> avoid that) without Body<br><br>Ah, sorry, I missed you want to send 302 with an empty body, not <br>just 302. Then instead of<br><br> return NGX_HTTP_MOVED_TEMPORARY;<br><br>you have to send actual response youself, like this:<br><br> r->headers_out.status = NGX_HTTP_MOVED_TEMPORARY;<br> r->headers_out.content_length_n = 0;<br><br> rc = ngx_http_send_header(r);<br><br> if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {<br> return rc;<br> }<br><br>
return ngx_http_send_special(r, NGX_HTTP_LAST);<br><br>Maxim Dounin<br><br>_______________________________________________<br>nginx mailing list<br><a ymailto="mailto:nginx@nginx.org" href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>http://mailman.nginx.org/mailman/listinfo/nginx<br><br><br> </div> </div> </blockquote></div> </div></body></html>