Nginx caching no header content-length

Vikas Parashar para.vikas at
Wed Mar 2 16:28:26 UTC 2016


I am using nginx(caching server) in front my tomcat. My tomcat is serving
header(content-length). But my nginx is not serving header content-length.

However, i can put that header in my config with some static value then it
will serve. But, in my case, the content length is coming from tomcat

Could anybody please help me here.

my config file

 location /comet {

        chunked_transfer_encoding off;
        proxy_http_version 1.1;
        proxy_buffering on;

        proxy_pass http://tomcat:8080/xxxx

            proxy_cache my_cache;

            # Adding a header to see the cache status in the browser
            add_header X-Cache-Status $upstream_cache_status;

            proxy_cache_key "$scheme$request_uri $http_x_seneca_uid";
            proxy_cache_min_uses 1;
            proxy_cache_valid 200 302 120m;
            proxy_cache_valid 404 1m;
            proxy_cache_use_stale error timeout invalid_header http_500
http_502 http_503 http_504;



My problem:- i have to pass content-header to my client. Could any body
please help me here
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list