-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Images] Updated docs for allowed origins #19795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 2 total issue(s) found.
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Deploying cloudflare-docs with
|
| Latest commit: |
5c51f28
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://184eb1b0.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://dpena-images-allowlist.cloudflare-docs-7ou.pages.dev |
| Before you can enable transformations, you must purchase Cloudflare Images. To use transformations, you will need to enable the feature on each zone: | ||
| Cloudflare will automatically cache every transformed image on our global network so that you store only the original image at your origin. | ||
|
|
||
| To enable this functionality on your zone: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to define exactly what our "this" statements are. Are they enabling the automatic caching or the image transformation? I assume it is the transformation so I offered this suggestion.
| To enable this functionality on your zone: | |
| To enable image transformation on your zone: |
|
|
||
| When optimizing remote images, you can specify which origins can be used as the source for transformed images. By default, Cloudflare accepts only source images from the zone where your transformations are served. | ||
|
|
||
| You will learn how to define and manage the origins for the source images that you want to optimize. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like...
- you should change to imperative "Learn how to..." and put it at the very beginning of this page or
- say "On this page,..." or
- get rid of this sentence entirely.
It's a bit confusing to run into here. Cause you introduced this idea at the first sentence already.
| You will learn how to define and manage the origins for the source images that you want to optimize. | ||
|
|
||
| :::note | ||
| This setting applies to requests from Cloudflare Workers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This setting applies to requests from Cloudflare Workers. | |
| Image transformation and origin definition applies to requests from Cloudflare Workers. |
What is 'this setting'?
|
|
||
| By default, your accepted sources are set to **allowed origins**. Cloudflare will always allow source images from the same zone where your transformations are served. | ||
|
|
||
| If you request a transformation with a source image from outside your **allowed origins**, then the image will be rejected. For example, if you serve transformations on your zone `a.com` and do not define any additional origins, then `a.com/image.png` can be used as a source image, but b.com/image.png will return an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you request a transformation with a source image from outside your **allowed origins**, then the image will be rejected. For example, if you serve transformations on your zone `a.com` and do not define any additional origins, then `a.com/image.png` can be used as a source image, but b.com/image.png will return an error. | |
| If you request a transformation with a source image from outside your **allowed origins**, then the image will be rejected. For example, if you serve transformations on your `a.com` zone and do not define any additional origins, then `a.com/image.png` can be used as a source image, but `b.com/image.png` will return an error. |
|
|
||
|  | ||
|
|
||
| When you add a root domain, subdomains are not accepted. In other words, if you add `b.com`, then source images from media.b.com will be rejected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| When you add a root domain, subdomains are not accepted. In other words, if you add `b.com`, then source images from media.b.com will be rejected. | |
| When you add a root domain, subdomains are not accepted. In other words, if you add `b.com`, then source images from `media.b.com` will be rejected. |
|
|
||
| To support all subdomains, you can use the `*` wildcard at the beginning of the root domain. For example, `*.b.com` will accept source images from the root domain (like `b.com/image.png`) as well as from subdomains (like `media.b.com/image.png` or `cdn.b.com/image.png`). | ||
|
|
||
| 3. Optionally, specify the **Path** for the source image. If no path is specified, then source images from all paths on this domain are accepted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. Optionally, specify the **Path** for the source image. If no path is specified, then source images from all paths on this domain are accepted. | |
| 3. Optionally, you can specify the **Path** for the source image. If no path is specified, then source images from all paths on this domain are accepted. |
|
|
||
| To support individual subdomains, you can define an additional origin such as `media.b.com`. If you add only `media.b.com` and not the root domain, then source images from the root domain (`b.com`) and other subdomains (`cdn.b.com`) will be rejected. | ||
|
|
||
| To support all subdomains, you can use the `*` wildcard at the beginning of the root domain. For example, `*.b.com` will accept source images from the root domain (like `b.com/image.png`) as well as from subdomains (like `media.b.com/image.png` or `cdn.b.com/image.png`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To support all subdomains, you can use the `*` wildcard at the beginning of the root domain. For example, `*.b.com` will accept source images from the root domain (like `b.com/image.png`) as well as from subdomains (like `media.b.com/image.png` or `cdn.b.com/image.png`). | |
| To support all subdomains, use the `*` wildcard at the beginning of the root domain. For example, `*.b.com` will accept source images from the root domain (like `b.com/image.png`) as well as from subdomains (like `media.b.com/image.png` or `cdn.b.com/image.png`). |
|
|
||
| When you add a root domain, subdomains are not accepted. In other words, if you add `b.com`, then source images from media.b.com will be rejected. | ||
|
|
||
| To support individual subdomains, you can define an additional origin such as `media.b.com`. If you add only `media.b.com` and not the root domain, then source images from the root domain (`b.com`) and other subdomains (`cdn.b.com`) will be rejected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To support individual subdomains, you can define an additional origin such as `media.b.com`. If you add only `media.b.com` and not the root domain, then source images from the root domain (`b.com`) and other subdomains (`cdn.b.com`) will be rejected. | |
| To support individual subdomains, define an additional origin such as `media.b.com`. If you add only `media.b.com` and not the root domain, then source images from the root domain (`b.com`) and other subdomains (`cdn.b.com`) will be rejected. |
|
|
||
| Cloudflare checks whether the defined path is at the beginning of the source path. If the defined path is not present at the beginning of the path, then the source image will be rejected. | ||
|
|
||
| For example, if you define an origin with domain `b.com` and path `/themes`, then `b.com/themes/image.png` will be accepted but `b.com/media/themes/image.pn`g will be rejected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| For example, if you define an origin with domain `b.com` and path `/themes`, then `b.com/themes/image.png` will be accepted but `b.com/media/themes/image.pn`g will be rejected. | |
| For example, if you define an origin with domain `b.com` and path `/themes`, then `b.com/themes/image.png` will be accepted but `b.com/media/themes/image.png` will be rejected. |
|
|
||
| When your accepted sources are set to **any origin**, any publicly available image can be used as the source image for transformations on this zone. | ||
|
|
||
| This setting is less secure and may allow third parties to serve transformations on your zone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This setting is less secure and may allow third parties to serve transformations on your zone. | |
| **Any origin** is less secure and may allow third parties to serve transformations on your zone. |
Addresses PCX-15781