I'm trying to cache static content which are basically inside the paths below in virtual server configuration. For some reason files are not being cached. I see several folders and files inside the cache dir but its always something like 20mb no higher no lower. If it were caching images for example would take at least 500mb of space.
Here is the nginx.conf cache part:
** nginx.conf **
proxy_cache_path /usr/share/nginx/www/cache levels=1:2 keys_zone=static$
proxy_temp_path /usr/share/nginx/www/tmp;
proxy_read_timeout 300s;
Heres the default virtual server.
**sites-available/default**
server {
listen 80;
root /usr/share/nginx/www;
server_name myserver;
access_log /var/log/nginx/myserver.log main;
error_log /var/log/nginx/error.log;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location ~* ^/(thumbs|images|css|js|pubimg)/(.*)$ {
proxy_pass http://backend;
proxy_cache static;
proxy_cache_min_uses 1;
proxy_cache_valid 200 301 302 120m;
proxy_cache_valid 404 1m;
expires max;
}
location / {
proxy_pass http://backend;
}
}