amazon s3

使用技巧





防盗链方法



在 Bucket policy 设置中设置

说明:
arn:aws:s3:::img.yeniugo.com/* 中的 img.yeniugo.combucket 名称

aws:Referer 里面的值为支持的网址

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Allow get requests originating from www.example.com and example.com.",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::img.yeniugo.com/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"https://*.yeniugo.com/*",
"https://yeniugo.com/*"
]
}
}
}
]
}


cors设置

<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://*.yeniugo.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

评论

此博客中的热门博文

certbot cloudflare申请通用域名证书

Centos7 安装 PHP7

在centos 7上用postfix,dovecot,mariaDB配置邮箱