Nginx caching no header content-length

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


Hello!

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:

http://nginx.org/en/docs/http/ngx_http_ssi_module.html
http://nginx.org/en/docs/http/ngx_http_sub_module.html
http://nginx.org/en/docs/http/ngx_http_gzip_module.html
http://nginx.org/en/docs/http/ngx_http_guzip_module.html
http://nginx.org/en/docs/http/ngx_http_addition_module.html

>  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
http://nginx.org/



More information about the nginx mailing list