Some times header cannot be sent due too high traffic

Hung Nguyen hungnv at
Thu Sep 24 09:18:42 UTC 2015


In my module I do something like this:
	nlog->action = "sending file to client";
        r->headers_out.status = NGX_HTTP_OK;
        r->headers_out.content_length_n = bucket->content_length;
        r->headers_out.last_modified_time = of.mtime;
        r->headers_out.content_type.len = sizeof ("text/html") - 1;
        r-> = (u_char *) "text/html";
        rc = ngx_http_send_header(r);
        if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
            ngx_log_error(NGX_LOG_ALERT, nlog, ngx_errno, ngx_close_file_n "ngx_http_send_header failed");
            return rc;

it’s ok when traffic is low, but when there are many user request to nginx, error log is full of these similar errors:

2015/09/17 08:57:16 [alert] 9915#0: *5205 close()ngx_http_send_header failed while sending file to client, client:, server: my.local, request: "GET /slides/128553.pdf?secl=LMz1w4xNwd9pt_88-ROxkw&sect=1442496276 HTTP/1.0", host: “m <>", referrer: " <>”

Is this a normal behavior, or there much be something wrong in my module cause nginx cannot send header to client? 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list