Aliyun-oss-storage
Aliyun-oss-storage copied to clipboard
优化了OSS自定义域名,Storage::url获取自已的资源地址
AliOssServiceProvider.php 修改内部节点为:$epInternal = empty($config['endpoint_internal']) ? $endPoint : $config['endpoint_internal']; // 内部节点 $client = new OssClient($accessId, $accessKey, $epInternal);
filesystems.php
参数描述:
···
'endpoint' => '外网访问节点',
'endpoint_internal' => '内网节点',
'cdnDomain' => '自定义OSS外网访问域名',
'ssl' => true,
'isCName' => true,
····
修改后: Storage::url($yourpath); 就可以获取正常的自定义url
AccessDenied: You have no right to access this object because of bucket acl.
被这个问题快弄疯了,各种查,差点提了阿里云工单...
最后才发现是$epInternal这个问题导致的...
oss 配置 endpoint 和 cdnDomain 时,不加 https:// 就正常,不用修改代码