- 论坛徽章:
- 0
|
本帖最后由 caesarok 于 2011-04-20 19:05 编辑
需求:
http://img.3g.cn/auto/
指向
http://202.75.220.51/autoupload/
不能用转跳,只能用缓存跟rewrite
配置如下:- location ~* /auto/
- {
- expires 21d;
- root /data/auto/;
- access_log /var/log/jbmon/backup/apache/access_nginx_s3gd-086.log;
- proxy_store on;
- proxy_store_access user:rw group:rw all:rw;
- proxy_temp_path /data/auto/;
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 10m;
- client_body_buffer_size 1280k;
- proxy_connect_timeout 900;
- proxy_send_timeout 900;
- proxy_read_timeout 900;
- proxy_buffer_size 40k;
- proxy_buffers 40 320k;
- proxy_busy_buffers_size 640k;
- proxy_temp_file_write_size 640k;
- rewrite "^/auto/(.*)$" /autoupload/$1 last;
- if ( !-e $request_filename)
- {
- proxy_pass http://202.75.220.51;
- }
- }
复制代码 但是返回结果却是 404,- http://202.75.220.51/autoupload/2011/4/19/152459017_220.jpg
复制代码 这个文件是存在的.
麻烦哪位大虾指点一下迷津!!!!!! |
|