I have the nginx reverse proxy to IIS to cache the images... now I have config the like this:
user root root; worker_processes 8; worker_rlimit_nofile 51200;
events { use epoll; worker_connections 51200; }
http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k;
sendfile on;
keepalive_timeout 30;
tcp_nodelay on;
proxy_temp_path /data0/proxy_temp_path;
proxy_cache_path /data0/proxy_cache_path levels=1:2 keys_zone=cache_one:1024m inactive=1d max_size=100g;
upstream my_server_pool {
server 172.16.0.101:80;
}
server
{
listen 80;
server_name www.tangrj.com;
location /
{
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://my_server_pool;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
{
proxy_cache cache_one;
proxy_cache_valid 200 304 12h;
proxy_cache_valid 301 302 1m;
proxy_cache_valid any 1m;
proxy_cache_key $host$uri$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://my_server_pool;
}
access_log off;
}
}
But the problem is strange....I can cache some staic images.The URL is like this:
'http://172.16.0.101/images/help/download/01.gif'
but some urls are can't cache...the url like this :
'http://www.tangrj.com/event/event_photo/20100619225748_0672.jpg' (I found the server is still IIS,not nginx).
U know I want to cache all the images to nginx,but why some images can't....
I understand that images was dynamic...not static...
anyone can tell me how to cache the 'http://www.tangrj.com/event/event_photo/20100619225748_0672.jpg '.
Thanks in advance and good luck!!