Welcome! Log In Create A New Profile


caching issues with nginx as reverse-proxy

June 29, 2016 09:00PM
I am using nginx as a reverse proxy and using the proxy-cache, I use the request body as a cache key as shown below.

location ^~ /mycachepath {
proxy_pass http://upstreamservers;
proxy_buffers 8 32K;
proxy_buffer_size 64K;
proxy_cache proxy-cache;
proxy_cache_key "$scheme$host$request_uri|$request_body";
proxy_cache_valid 200 1m;
proxy_cache_methods POST GET;
proxy_ignore_headers Cache-Control;
add_header X-Cache-Status $upstream_cache_status;

However, I observe that smaller request bodies the cache works perfectly but if the request body gets too big then it will actually *always* return the cached version. Does anyone have any idea what's going on and if someone also has come across a similar issue ? There is nothing in the logs except for this statement - "[warn] 29768#0: *2329 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000009," for a given request.
Any help is much appreciated.

Subject Author Posted

caching issues with nginx as reverse-proxy

blue.outrigger June 29, 2016 09:00PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 50
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready