request body and client_body_buffer_size

Jeroen Ooms jeroenooms at gmail.com
Thu Sep 26 00:41:44 UTC 2013


One more question regarding this:

> The
>    proxy_no_cache $request_body_file;
> should do the trick, see http://nginx.org/r/proxy_no_cache.

I tried this and get a warning:
   nginx: [warn] "proxy_no_cache" functionality has been changed in
0.8.46, now it should be used together with "proxy_cache_bypass"

Do I just need to add an additional line:
   proxy_cache_bypass $request_body_file;

It is not clear to me how proxy_cache_bypass is different from proxy_no_cache.





On Fri, Sep 13, 2013 at 8:56 PM, Jeroen Ooms <jeroenooms at gmail.com> wrote:
> Is it correct that when $content_length > client_body_buffer_size,
> then $request_body == "" ? If so this would be worth documenting at
> request_body.
>
> I am using:
>
>     proxy_cache_methods POST;
>     proxy_cache_key "$request_method$request_uri$request_body";
>
> Which works for small requests, but for large requests clients got
> very strange results due to $request_body being empty and hence
> getting false cache hits for completely different form posts.
>
> Is there something available like $body_hash that can be used as a
> caching key even for large request bodies? Or alternatively, how
> would I configure nginx to not cache requests when content_length
> is larger than client_body_buffer_size?



More information about the nginx mailing list