+
50
-

阿里云的oss的下行费用过高怎么解决?

随着经济的下行,阿里云等云服务商开始对oss及cdn加速等产品上调价格,现在各大云服务器上阿里云、腾讯云的cdn下载费用翻了好几倍了。阿里云的oss的下行费用过高怎么解决?


网友回复

+
0
-

有两种方式:

1、购买流量包

2、购买一个廉价的ecs充当中间缓存

我们以nginx为例

http {


    server {
        listen 80;
        server_name youdomian.com;


        location / {
            proxy_pass http://oss的阿里云访问地址

            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

            # 缓存配置
            proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=MYCACHE:10m max_size=10g inactive=1y;
            proxy_cache MYCACHE;
            proxy_cache_valid 200 1y; # 设置缓存有效期为1年
            proxy_cache_valid 404 1m; # 设置未找到的请求的缓存有效期
            proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
            proxy_cache_lock on;
        }
    }
}

我知道答案,我要回答