atom feed9 messages in ru.sysoev.nginxContent-Length header missing after p...
FromSent OnAttachments
James FidellAug 23, 2011 11:43 am 
Geoge.QAug 23, 2011 10:26 pm 
Maxim DouninAug 23, 2011 11:13 pm 
James FidellAug 24, 2011 12:45 am 
James FidellAug 24, 2011 12:52 am 
Igor SysoevAug 24, 2011 3:37 am 
James FidellAug 24, 2011 4:19 am 
Igor SysoevAug 24, 2011 5:20 am 
Matthias R. W.Sep 6, 2011 7:03 am 
Subject:Content-Length header missing after proxying
From:James Fidell (jam@cloud9.co.uk)
Date:Aug 23, 2011 11:43:24 am
List:ru.sysoev.nginx

I have nginx configured to proxy to an upstream using the following in nginx.conf:

http { upstream app { server localhost:8080; }

server { listen 80;

location / { proxy_pass http://app; # proxy_pass_header Content-Length; } } }

The upstream returns some data with the HTTP Content-Length header set. Using wget to connect directly I see:

Connecting to localhost|127.0.0.1|:8080... connected. HTTP request sent, awaiting response... HTTP/1.0 200 OK Content-Type: application/x-javascript Connection: keep-alive Content-Length: 44552 Length: 44552 (44K) [application/x-javascript]

When I make a request via nginx however, the Content-Length header is no longer present (again using wget):

Connecting to localhost|127.0.0.1|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Server: nginx/1.0.5 Date: Tue, 23 Aug 2011 18:40:30 GMT Content-Type: application/x-javascript Connection: close Length: unspecified [application/x-javascript]

Is there any obvious reason this should be happening, or something I'm doing wrong? The proxy_pass_header directive in the configuration file seems to make no difference to the outcome when I uncomment it.

Thanks, James