Transforming images via subdomain on zone

For Workes & Pages, what is the name of the domain?

corfluence.com

What is the error number?

403

What is the error message?

Forbidden

What is the issue or error you’re encountering

I want to use Cloudflare image transformations via URL in my multi tenancy application where every tenant has a custom subdomain under my root domain (tenant1.corfluence.com). I can’t get it to work so that images are transformed on the tenant’s subdomains.

What steps have you taken to resolve the issue?

I’ve already tried accessing the /cdn-cgi/image route on both the current tenants domain and the root domain.

It’s important to note that my user is always on a subdomain (tenant1.corfluence.com) and neither setting the image source to tenant1corfluencecom/cdn-cgi/image/… nor corfluencecom/cdn-cgi/image/… did work and both resulted in a 403 Forbidden

What are the steps to reproduce the issue?

  1. Enable image transformations for a given zone
  2. Create a subdomain under the given zone and try to serve a transformed image

By default, source images need to have the same origin as the zone where you want to enabled the transformed image, e.g. corfluence.com/hi.png.

If you enable the “Resize from any origin” setting under Images → Transformations → , then you can transform URLs from any origin (e.g. example.com/hi.png). Can you enable this setting and try your links again?

Thank you very much. After disabling this option, it started working indeed. I thought that would be regarding the domain the user is currently on, not the domain the image is hosted on.

Nevertheless, I would like to make sure that only valid images of my application are transformed. Is there any other way to, for example, allowlist a specific S3-Bucket-Domain, or would I need to link the bucket to a subdomain under my zone to turn this setting back on but still make sure the transformation works?

If you have a Business or Enterprise account, then you can set up a rule to specify an allowlist.

We’re working on making this functionality available for all customers. In the meantime, for Free and Pro customers, the bucket will need to be under your zone.

This topic was automatically closed after 15 days. New replies are no longer allowed.