我试图缓存基本上在虚拟服务器配置下面的路径内的静态内容。由于某些原因文件没有被缓存。我看到缓存目录中的几个文件夹和文件,但它总是像20mb不高不低。例如,如果缓存图片需要至少500mb的空间。nginx作为缓存代理不缓存任何
这里是nginx.conf缓存部分:
** 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;
继承人的默认虚拟服务器。
**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;
}
}
缓存状态有土特产品tryed打开错误日志? – 2012-02-10 17:47:36
是的。没有结论。 – 2012-02-10 18:07:50