无法通过AWS Serverless Image Handler使用我的域调整图像大小

时间:2018-09-26 07:55:30

标签: amazon-web-services amazon-s3 amazon-cloudformation amazon-cloudfront

遵循documentation之后,我让无服务器映像处理程序在AWS上工作;但是,当我使用自己的域名时,在处理图像时遇到了问题。

当前,我的CNAME指向无服务器映像处理程序的云端URL;但是,我遇到以下行为:

无论我使用哪个URL,都可以检索原始图像:

仅当我使用cloudfront网址时,才能操作图像:

使用我自己的域时收到的错误如下:

<Error>
<script/>
<script/>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>100x100/myfolder/1537943828682-image3.jpg</Key>
<RequestId>request_id</RequestId>
<HostId>host_id</HostId>
</Error>

从错误消息中,似乎我正在尝试查找路径为100x100/myfolder/1537943828682-image3.jpg的对象。 我应该如何使用自己的域来检索图像的受控版本?

编辑:

我意识到我没有为图像调整大小分发CDN设置备用域名,我认为这可能是一个潜在问题。将我的域名添加为备用域名后,我在访问https://subdomain.mydomain.com/100x100/myfolder/image.jpg时收到以下403错误:

403 ERROR
The request could not be satisfied.
Bad request.
Generated by cloudfront (CloudFront)

不调整图像大小的URL仍按预期运行。

0 个答案:

没有答案