Welcome! Log In Create A New Profile

Advanced

Content-Length ###s being served, but no actual content

February 13, 2013 01:54PM
I've discovered what I believe to be a bug (yeah I know everyone is already rolling their eyes) :D

I believe that my CGI is returning some data (perhaps Content-Type header) and then is occasionally stalling due to backend load.
This is fine, and fastcgi_read_timeout can be adjusted to deal with the issue of course.
However, it appears that when Nginx times out the connection it still serves a non-empty Content-Length!

HTTP/1.1 200 OK^M
Server: nginx/1.2.6^M
Date: Tue, 05 Feb 2013 20:12:31 GMT^M
Content-Type: text/x-json^M
Content-Length: 397^M
Connection: keep-alive^M
X-WSL-Version: 1.0^M
^M
HTTP/1.1 200 OK^M
Server: nginx/1.2.6^M
Date: Tue, 05 Feb 2013 20:12:38 GMT^M
Content-Type: text/x-json^M
Content-Length: 396^M
Connection: keep-alive^M
^M
(There is actual JSON data here, I clipped it out, trust me!)

----
See that 397 bytes of non-existent data?
I tested on nginx/0.8.53 and nginx/1.2.6. I'm using netcat6 to run the tests with http-pipelining.
I also tried various different kernels, and ran the tests on my local network to rule out weird internet stuff.
SubjectAuthorPosted

Content-Length ###s being served, but no actual content

tsaavikFebruary 13, 2013 01:54PM

Re: Content-Length ###s being served, but no actual content

Maxim DouninFebruary 14, 2013 06:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready