Content-Length header missing after proxying

Geoge.Q quan.nexthop at gmail.com
Wed Aug 24 05:27:22 UTC 2011


please help give out the info " nginx -V" , then we can give your help.

thanks
george

On Wed, Aug 24, 2011 at 2:44 AM, James Fidell <james at cloud9.co.uk> wrote:

> 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
>
> ______________________________**_________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginx<http://mailman.nginx.org/mailman/listinfo/nginx>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20110824/e736744e/attachment.html>


More information about the nginx mailing list