proxy_cache

Payam Chychi pchychi at gmail.com
Tue Jul 7 22:27:26 MSD 2009


On Tue, Jul 7, 2009 at 11:10 AM, vburshteyn<nginx-forum at nginx.us> wrote:
> Hi folks,  Before i get started i read that somebody posted simmilar thread but since i am still learning this, the answer/solution did not make sense.
>
> I have set up proxy_cache on my nginx but it seems that it is not writing to the cache directory.
>
>
> http {
>
> upstream backend
> {
> server 10.176.67.151:8080;
> }
>
>
> proxy_cache_path /etc/nginx/cache/ levels=1:2 keys_zone=one:10m max_size=200m;
> #proxy_temp_path /etc/nginx/temp;
>
>
> server {
>    listen 10.176.67.151:80;
>
> location / {
> proxy_pass http://backend;
> proxy_cache one;
> proxy_cache_key         backend$request_uri;
> proxy_cache_valid       10m;
> include /etc/nginx/proxy.conf;
>
> }
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3826,3826#msg-3826
>
>
>

can you run logging with debug? then show us the log file... it will
show exactly what is happening. Also, i would recomend you NOT using
the following if you host more than 1 site on teh same upstream:

" proxy_cache_key         backend$request_uri;"
make it uniqu to every site if possible else you may get wrong content
served back out to requests that have the same md5

-Payam


-- 
Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer





More information about the nginx mailing list