Welcome! Log In Create A New Profile

Advanced

Re: twice chunked

Maxim Dounin
August 10, 2011 10:46AM
Hello!

On Wed, Aug 10, 2011 at 09:42:29AM -0400, HajoLOcke wrote:

> Hello,
>
> i use nginx 1.1.0 as balancer in front of some apache-server. In some
> cases, where the apache is generating bigger pages it sends content as
> chunked, nginx is adding a second "chunked" to http-response header.
> This is confusing Browsers and looks like:
>
> Transfer-Encoding: chunked, chunked
>
> nginx is compiled with:
> nginx: nginx version: nginx/1.1.0
> nginx: TLS SNI support enabled
> nginx: configure arguments: --conf-path=/etc/nginx/nginx.conf
> --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
> --lock-path=/var/lock/nginx.lock
> --http-log-path=/var/log/nginx/access.log
> --http-client-body-temp-path=/var/lib/nginx/body
> --http-proxy-temp-path=/var/lib/nginx/proxy
> --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
> --with-http_stub_status_module --with-http_flv_module
> --with-http_ssl_module --with-http_dav_module
> --with-http_gzip_static_module --with-http_realip_module --with-mail
> --with-mail_ssl_module --with-ipv6
> --add-module=/usr/src/nginx-1.1.0-1/modules/nginx-upstream-fair
>
>
> What can id do to avoid this double chunked in header? Parts of conf
> needed? ( no special stuff in it)

There are two basic options:

1. Fix backend to actually complain to HTTP specification (i.e.
do not send chunked responses to HTTP/1.0 requests). You may try

SetEnv downgrade-1.0

in Apache config. Alternatively, grep your php scripts for things like

header("HTTP/1.1 ...");

and change them to be "HTTP/1.0 ..." (the problematic Apache
behaviour is caused by PHP module which sets r->proto_num to 1.1
if script uses header("HTTP/1.1 ..."), it should never ever do
that).

2. Try patch which adds HTTP/1.1 support in nginx proxy module,
see here:

http://mailman.nginx.org/pipermail/nginx/2011-August/028324.html

With the patch nginx understands chunked from http backends and
everything should be fine even if backend sends chunked over
HTTP/1.0 (you just need to compile with patch, no further actions
related to keepalive upstream connections required).

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

twice chunked

HajoLOcke August 10, 2011 09:42AM

Re: twice chunked

Ensiferous August 10, 2011 10:23AM

Re: twice chunked

Maxim Dounin August 10, 2011 10:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
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