You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/images/transform-images/sources.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ sidebar:
7
7
8
8
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.
9
9
10
-
You will learn how to define and manage the origins for the source images that you want to optimize.
10
+
On this page, you will learn how to define and manage the origins for the source images that you want to optimize.
11
11
12
12
:::note
13
-
This setting applies to requests from Cloudflare Workers.
13
+
The allowed origins setting applies to requests from Cloudflare Workers.
14
14
15
15
If you use a Worker to optimize remote images via a `fetch()` subrequest, then this setting may conflict with existing logic that handles source images.
16
16
:::
@@ -31,7 +31,7 @@ You can restrict source images to **allowed origins**, which applies transformat
31
31
32
32
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.
33
33
34
-
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.
34
+
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.
35
35
36
36
To define a new origin:
37
37
@@ -40,17 +40,17 @@ To define a new origin:
40
40
41
41

42
42
43
-
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.
43
+
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.
44
44
45
-
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.
45
+
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.
46
46
47
-
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`).
47
+
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`).
48
48
49
-
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.
49
+
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.
50
50
51
51
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.
52
52
53
-
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.
53
+
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.
54
54
55
55
4. Select **Add**. Your origin will now appear in your list of allowed origins.
56
56
5. Select **Save**. These changes will take effect immediately.
@@ -63,4 +63,4 @@ If you change your accepted sources to **any origin**, then your list of sources
63
63
64
64
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.
65
65
66
-
This setting is less secure and may allow third parties to serve transformations on your zone.
66
+
**Any origin** is less secure and may allow third parties to serve transformations on your zone.
0 commit comments