Nginx caching no header content-length

Maxim Dounin mdounin at
Wed Mar 2 17:53:19 UTC 2016


On Wed, Mar 02, 2016 at 10:33:34PM +0530, Vikas Parashar wrote:


> don't know how to do it.

Check your configuration for any modules which are expected to 
change content.  Disable them (comment out relevant directives out 
or switch off in a particular location).

In particular, check for the following directives:

- ssi;
- sub_filter;
- gzip, gunzip;
- add_before_body, add_after_body.

More details can be found here:

>  Could you please let me know, how to add header
> forcefully.
> like add_header 'Content-Length' $upstream_http_content_length;
> somehow,
> add_header 'Content-Length' 12312312
> Static value is working fine. But at the moment, i replaced it from
> upstream_http_content_length

You shouldn't try to add Content-Length manually.  This is very 
likely to break things completely.

Maxim Dounin

More information about the nginx mailing list