# Nginx caching but shouldn't be

**URL:** <https://www.ruby-forum.com/t/nginx-caching-but-shouldnt-be/221641>\
**Category:** NGINX\
**Created:** [July 23, 2012, 6:45pm UTC](https://www.ruby-forum.com/t/nginx-caching-but-shouldnt-be/221641 "2012-07-23T18:45:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 23, 2012, 6:45pm UTC](https://www.ruby-forum.com/t/nginx-caching-but-shouldnt-be/221641/1 "2012-07-23T18:45:15Z")

</div>

We have nginx running, and for reasons I don’t understand, it seems to  
be caching content to /var/lib/nginx/proxy. I can’t even find this  
setting in the configuration anywhere, i.e. the following returns  
nothing:

root@lb01:/etc/nginx# find /etc/nginx | xargs grep “/var/lib/nginx”

We have the following set:  
proxy\_no\_cache 1;  
proxy\_cache\_bypass 1;

I have pasted our config to [##### File /etc/nginx/nginx.conf:user www-data;worker\_processes 4;pid /var - Pastebin.com](http://pastebin.com/w7E0trG6). If anyone has  
any ideas why nginx is caching, it would be appreciated.

Doug.

Posted at Nginx Forum:

> **[Nginx caching... but shouldn't be.](https://forum.nginx.org/read.php?2,228893,228893#msg-228893)**
>
> We have nginx running, and for reasons I don't understand, it seems to be caching content to /var/lib/nginx/proxy. I can't even find this setting in the configuration anywhere, i.e. the following returns nothing: root@lb01:/etc/nginx# find /etc/nginx...

---

<div class="post-metadata">

**Author:** ![dgarstang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dgarstang](https://www.ruby-forum.com/u/dgarstang)\
**Post date:** [July 23, 2012, 6:56pm UTC](https://www.ruby-forum.com/t/nginx-caching-but-shouldnt-be/221641/2 "2012-07-23T18:56:57Z")

</div>

Hello!

On Mon, Jul 23, 2012 at 12:44:36PM -0400, dgarstang wrote:

> I have pasted our config to [##### File /etc/nginx/nginx.conf:user www-data;worker\_processes 4;pid /var - Pastebin.com](http://pastebin.com/w7E0trG6). If anyone has  
> any ideas why nginx is caching, it would be appreciated.

I would rather suggest it’s proxy temporary files, not cache. If  
you don’t want nginx to buffer responses to disk, use  
proxy\_max\_temp\_file\_size directive. See here for details:

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_path)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

Maxim D.
