Cloudflare Image Transformation Returning 403

I am attempting to transform images using cdn-cgi/image and when routing through the zone I'm getting a 403 error but not when accessing the S3 bucket raw? The following object in S3 is accessible https://hlfwstg.s3.us-east-1.amazonaws.com/user/e51c649b-8529-4445-a78d-00e29993dd06/carousels/8414E019-930C-4A03-8202-CDA1F8C919C2/dqEJlnXEzCkTXky_Yr_JV1C82C4DF-0004-48A9-8FE5-096952C60AC3 The following seems to return a 403 https://halfway.io/cdn-cgi/image/w=100/https://hlfwstg.s3.us-east-1.amazonaws.com/user/e51c649b-8529-4445-a78d-00e29993dd06/carousels/8414E019-930C-4A03-8202-CDA1F8C919C2/dqEJlnXEzCkTXky_Yr_JV1C82C4DF-0004-48A9-8FE5-096952C60AC3 How is it possible that when I access the file raw it's fine but not when routed through Cloudflare?
HTTP/1.1 403 Forbidden
Date: Wed, 19 Mar 2025 02:38:53 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 87
Connection: close
CF-Ray: 922998a11bf7ab96-YYZ
CF-Cache-Status: MISS
Cache-Control: max-age=14400
Vary: Accept
cf-resized: err=9408
content-security-policy: default-src 'none'; navigate-to 'none'; form-action 'none'
x-content-type-options: nosniff
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=PmtTniQnqmd%2B8spcw8pdN8KRz4ZxzWRM0O%2FYCpp0Cj0dkgLhUI4dsVg34C%2Fkhw4MYxoxAstFnGowXjhOYmoWbQxl6YvAmNb2PieTn3MQgMLmV9hsgZRliLkm4071"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=5499&min_rtt=4661&rtt_var=2051&sent=8&recv=8&lost=0&retrans=0&sent_bytes=3134&recv_bytes=1213&delivery_rate=905348&cwnd=248&unsent_bytes=0&cid=4bd499cad41566ac&ts=292&x=0"

ERROR 9408: Could not fetch the image — the server returned HTTP error 403 Forbidden
HTTP/1.1 403 Forbidden
Date: Wed, 19 Mar 2025 02:38:53 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 87
Connection: close
CF-Ray: 922998a11bf7ab96-YYZ
CF-Cache-Status: MISS
Cache-Control: max-age=14400
Vary: Accept
cf-resized: err=9408
content-security-policy: default-src 'none'; navigate-to 'none'; form-action 'none'
x-content-type-options: nosniff
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=PmtTniQnqmd%2B8spcw8pdN8KRz4ZxzWRM0O%2FYCpp0Cj0dkgLhUI4dsVg34C%2Fkhw4MYxoxAstFnGowXjhOYmoWbQxl6YvAmNb2PieTn3MQgMLmV9hsgZRliLkm4071"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=5499&min_rtt=4661&rtt_var=2051&sent=8&recv=8&lost=0&retrans=0&sent_bytes=3134&recv_bytes=1213&delivery_rate=905348&cwnd=248&unsent_bytes=0&cid=4bd499cad41566ac&ts=292&x=0"

ERROR 9408: Could not fetch the image — the server returned HTTP error 403 Forbidden
3 Replies
rehat
rehatOP2mo ago
I have also added the following CORS configuration to my S3 bucket to no avail:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
BUMP
Laudian
Laudian2mo ago
Works for me. You should check your AWS logs to find out why your request is getting blocked.
No description
rehat
rehatOP2mo ago
Resolved it in the end! Turned out to be a weird issue with my bucket

Did you find this page helpful?