Welcome! Log In Create A New Profile

Advanced

Re: Content Truncating

Maxim Dounin
April 07, 2009 08:27PM
Hello!

On Tue, Apr 07, 2009 at 03:54:36PM -0400, michael wrote:

> Hi,
>
> I am having a weird issue where nginx is truncating a few bytes of content from the end of files. The files are being served from PHP (FastCGI via php-fpm) using PHP's readfile(). The PHP application sends out a Content-Length header using filesize() and then spits out the contents of the file to nginx using readfile().
>
> The content however is coming short by a few bytes. nginx sends the correct Content-Length, but closes the connection a few bytes short of the Content-Length number of bytes. This doesn't happen for all files and I can't seem to find a pattern either.
>
> Any ideas?

There were some reports of strange things happending with php's
readfile(). Personally I believe it's php issue (probably
configuration/programming one - e.g. memory limit reached due to
output buffering activated and script terminated or something like
this). But I've never seen any debug info to prove this point.

If you are able to reproduce it - could you please build debug log
and post it?

Of course it's much better to use X-Accel-Redirect instead as
already suggested.

Maxim Dounin
Subject Author Posted

Content Truncating

michael April 07, 2009 03:54PM

Re: Content Truncating

michael April 07, 2009 03:56PM

Re: Content Truncating

mike April 07, 2009 05:16PM

Re: Content Truncating

michael April 07, 2009 06:32PM

Re: Content Truncating

mike April 07, 2009 07:24PM

Re: Content Truncating

michael April 07, 2009 07:56PM

Re: Content Truncating

mike April 07, 2009 08:15PM

Re: Content Truncating

Maxim Dounin April 07, 2009 08:27PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 108
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready