Welcome! Log In Create A New Profile


Re: missing Content-Length in nginx response

Maxim Dounin
April 14, 2011 06:30AM

On Thu, Apr 14, 2011 at 01:50:49AM -0600, Ruslan Dautkhanov wrote:

> Hello,
> I have problems in a transition from Apache to nginx.
> There are 2 nginx servers working together:
> nginx (balancing, proxy) -> another nginx -> static files and php-fpm
> Pages that are loaded through ajax doesn't show up.
> I checked through Firebug and the only differences are in following
> response headers
> 1. Transfer-Encoding chunked (presents only in Nginx response)
> 2. Content-Length 571 (presents only in Apache response)...
> How I can force nginx to work correctly here? Please see full dump of
> headers below.

There is nothing incorrect in returning chunked response as long
as client uses HTTP/1.1.

I tend to think that your issue is unrelated. You may want to dig
further into your ajax code to see what actually goes wrong.

> nginx 0.8.54
> Tried to switch off gzip - it didn't affect this issue at all.
> ssl is not used in this configuration.
> CentOS 5.5.

nginx uses chunked if (a) response length isn't known (i.e.
backend doesn't return it) or (b) it has to modify response body.

The (b) includes gzip filter, ssi filter, sub filter, addition
filter, and charset filter. With all of them switched off
(default) you should see original Content-Length from backend's
response (if any).

Maxim Dounin

nginx mailing list
Subject Author Posted

missing Content-Length in nginx response

Ruslan Dautkhanov April 14, 2011 03:52AM

Re: missing Content-Length in nginx response

Maxim Dounin April 14, 2011 06:30AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready