要解决AWS S3静态网站无法从子域名启动的问题,你可以按照以下步骤进行操作:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSubdomainAccess",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*",
"Condition": {
"StringLike": {
"aws:Referer": "http://subdomain.yourdomain.com/*"
}
}
}
]
}
确保将"your-bucket-name"替换为你的存储桶名称,并将“subdomain.yourdomain.com”替换为你的子域名。 9. 单击“保存”以保存存储桶策略。 10. 通过访问子域名(例如http://subdomain.yourdomain.com)来测试是否可以正常访问S3静态网站。
通过以上步骤,你应该能够解决AWS S3静态网站无法从子域名启动的问题。