默认的 oss 只有阿里云的域名才支持 https
这样采用自己的域名访问代理
例如:
proxy_pass http://ossurl/;
ossurl 分为内网和外网
如果和 oss 在一个网段直接内网调用
如果不在可以走公网
这个地址阿里云控制台 bucket 的概述有提供
- server {
- listen 443;#default_server;
- server_name image.bb.com;
- access_log / home / data / logs / nginx / oss.log main;
- ssl on;
- ssl_certificate / opt / CA / bb.pem;
- ssl_certificate_key / opt / CA / bb.key;
- ssl_session_timeout 5m;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers HIGH: !RC4: !MD5: !aNULL: !eNULL: !NULL: !DH: !EDH: !EXP: +MEDIUM;
- ssl_prefer_server_ciphers on;
- location / {
- proxy_pass http: //ossurl/;
- proxy_set_header Referer http: //image.bb.com;
- }
- }
来源: http://www.bubuko.com/infodetail-2506716.html