location / {
if (!-e $request_filename) {
proxy_pass http://wx3.sinaimg.cn;
}
root /www/wwwroot/www.xxxxxx.com;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path cache_tmp;
proxy_set_header x-real-ip $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
}
宝塔面板默认反向代理是将缓存文件存储到了/www/server/nginx/proxy_cache_dir目录,而且缓存的文件并非是原文件,后期无法维护。 因此修改下反向代理配置文件就可以了。
这个反向代理需要开一段时间,因为反向代理缓存是需要访客访问到了图片后才会缓存下来。有可能你个别文章一直没有人访问,结果里面图片就没有缓存下来。可以自己使用工具访问一遍你的文章,让图片加载一次,加载一次即可完成缓存。
- All rights reserved.
- No part of this website, including text and images, may be reproduced, modified, distributed, or transmitted in any form or by any means, without the prior written permission of the author.
- Unauthorized commercial use is strictly prohibited.
- Unauthorized personal use is strictly prohibited.