<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello, <div class=""><br class=""></div><div class="">In my module I do something like this:</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>nlog->action = "sending file to client";</div><div class=""><div class="">        r->headers_out.status = NGX_HTTP_OK;</div></div><div class=""><div class="">        r->headers_out.content_length_n = bucket->content_length;</div></div><div class=""><div class="">        r->headers_out.last_modified_time = of.mtime;</div></div><div class=""><div class="">        r->headers_out.content_type.len = sizeof ("text/html") - 1;</div></div><div class=""><div class="">        r->headers_out.content_type.data = (u_char *) "text/html";</div></div><div class=""><div class="">        rc = ngx_http_send_header(r);</div></div><div class=""><div class="">        if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {</div></div><div class=""><div class="">            ngx_log_error(NGX_LOG_ALERT, nlog, ngx_errno, ngx_close_file_n "ngx_http_send_header failed");</div></div><div class=""><div class="">            return rc;</div></div><div class=""><div class="">        }</div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">it’s ok when traffic is low, but when there are many user request to nginx, error log is full of these similar errors:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><span lang="EN-US" style="font-family: Consolas; font-size: 14px;" class="">2015/09/17 08:57:16 [alert] 9915#0: *5205 close()ngx_http_send_header failed while sending file to client, client: 127.0.0.1, server: my.local, request: "GET /slides/128553.pdf?secl=LMz1w4xNwd9pt_88-ROxkw&sect=1442496276 HTTP/1.0", host: “<a href="http://kvazar.china-cdn88nmbwacdnln8hq8qwe.com" style="color: purple;" class="">m</a><a href="http://y.server.com" class="">y.server.com</a>", referrer: "</span><a href="http://uakino.net/uppod.swf" style="color: purple; font-family: Consolas; font-size: 14px;" class=""><span lang="EN-US" class="">http://my.server.com/uppod.swf</span></a><span lang="EN-US" style="font-family: Consolas; font-size: 14px;" class="">”</span></div></blockquote><div class=""><span lang="EN-US" style="font-family: Consolas; font-size: 14px;" class=""><br class=""></span></div><div class=""><span lang="EN-US" style="font-family: Consolas; font-size: 14px;" class=""><br class=""></span></div><div class=""><br class=""></div><div class="">Is this a normal behavior, or there much be something wrong in my module cause nginx cannot send header to client? </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Hưng</div><div class=""><br class=""></div></body></html>