# Nginx-reverse-proxy-proxy-cache-inside-if-block-possible

**URL:** <https://www.ruby-forum.com/t/nginx-reverse-proxy-proxy-cache-inside-if-block-possible/235842>\
**Category:** NGINX\
**Created:** [July 19, 2013, 3:48am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-proxy-cache-inside-if-block-possible/235842 "2013-07-19T03:48:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [July 19, 2013, 3:48am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-proxy-cache-inside-if-block-possible/235842/1 "2013-07-19T03:48:13Z")

</div>

Hi

I am running a BBS server(nginx).  
And now I want to setup a cache server (using nginx)in front of the BBS  
server to cache the pic .

The URL for the pic is something like this:  
[http://www.mysite.com/forum.php?mod=attachment&aid=MjIwODgyfDhiNWNiNzE4fDEzNzQxMTc1MzB8OTgyNzR8OTgwNw%3D%3D&noupdate=yes](http://www.mysite.com/forum.php?mod=attachment&aid=MjIwODgyfDhiNWNiNzE4fDEzNzQxMTc1MzB8OTgyNzR8OTgwNw%3D%3D&noupdate=yes)  
It is not as usual as something like this —  
[http://www.mysite.com/img/xxxx.jpg](http://www.mysite.com/img/xxxx.jpg)

Following this page:

> <https://serverfault.com/questions/389571/nginx-reverse-proxy-proxy-cache-inside-if-block-possible>

The cache config on the cache server is :(nginx version: nginx/1.1.19)

proxy\_temp\_path /nginx-cache/tmp 1 2;  
proxy\_cache\_path /nginx-cache/cache1 levels=1:2 keys\_zone=cache1:100m  
inactive=1d max\_size=15g;

map $arg\_mod $skip\_cache {  
default 1;  
attachment 0;  
}  
log\_format format1 '$remote\_addr - $remote\_user [$time\_local] ’  
'“$request” $status $body\_bytes\_sent ’ ‘“$http\_referer”  
“$http\_user\_agent” $upstream\_cache\_status’;  
location /forum.php {  
proxy\_pass [http://1.1.1.1](http://1.1.1.1); # 1.1.1.1 is the real ip of BBS  
server.  
proxy\_cache cache1;  
proxy\_cache\_key $host$uri$is\_args$args;  
proxy\_cache\_valid 720m;  
expires 3d;  
proxy\_cache\_bypass $skip\_cache;  
proxy\_no\_cache $skip\_cache;  
}

When I access  
[http://www.mysite.com/forum.php?mod=attachment&aid=MjIwODgyfDhiNWNiNzE4fDEzNzQxMTc1MzB8OTgyNzR8OTgwNw%3D%3D&noupdate=yes](http://www.mysite.com/forum.php?mod=attachment&aid=MjIwODgyfDhiNWNiNzE4fDEzNzQxMTc1MzB8OTgyNzR8OTgwNw%3D%3D&noupdate=yes)  
on my IE.

I see the following log on cache server:  
client IP - - [18/Jul/2013:14:21:37 +0400] “GET  
/forum.php?mod=attachment&aid=MjIwODgyfDhiNWNiNzE4fDEzNzQxMTc1MzB8OTgyNzR8OTgwNw%3D%3D&noupdate=yes  
HTTP/1.1” 200 4194 “[http://www.mysite.com/thread-9971-1-1.html](http://www.mysite.com/thread-9971-1-1.html)”  
“Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0;;  
.)” MISS

And at that moment,the pic did not shown on my IE.

My questions are:  
What does “MISS” excatly mean?  
Does it mean that cache server does not get the pic from BBS server ?  
If so , why?  
or are there any other ways to setup nginx cache for my situation?  
And hint is appreciated.  
Thank you !

removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 19, 2013, 10:26am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-proxy-cache-inside-if-block-possible/235842/2 "2013-07-19T10:26:40Z")

</div>

MISS means the ressouce is not found in the cache

btw, do you see any requests getting cahced / your caching-dir is  
filling  
or do you see 100% MISS?

maybe: [proxy\_cache 100% MISS](http://forum.nginx.org/read.php?11,163400,163695)

do you use cache-control-headerrs?

Posted at Nginx Forum:

> **[Re: nginx-reverse-proxy-proxy-cache-inside-if-block-possible](https://forum.nginx.org/read.php?2,241023,241024#msg-241024)**
>
> Hi I am running a BBS server(nginx). And now I want to setup a cache server (using nginx)in front of the BBS server to cache the pic . The URL for the pic is something like this:...
