Welcome! Log In Create A New Profile

Advanced

nginx reverse proxy IIS to cache the pictures

Posted by pp263020776 
nginx reverse proxy IIS to cache the pictures
June 28, 2010 05:52AM
0


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!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready