is this OK? r->headers_out.status = NGX_HTTP_REDIRECT; r->headers_out.content_length_n = 0; ... // the code set "Location" header ngx_http_send_header(r); Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200929,200937#msg-200937