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
Preview URLs allow you to preview new versions of your Worker without deploying it to production.
14
16
15
-
Every time you create a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker a unique preview URL is generated. Preview URLs take the format: `<VERSION_PREFIX>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev`. New [versions](/workers/configuration/versions-and-deployments/#versions) of a Worker are created on [`wrangler deploy`](/workers/wrangler/commands/#deploy), [`wrangler versions upload`](/workers/wrangler/commands/#upload) or when you make edits on the Cloudflare dashboard. By default, preview URLs are enabled and available publicly.
17
+
There are two types of preview URLs:
18
+
19
+
-**Version-Prefixed Preview URLs**: A unique URL generated automatically for each new version of your Worker.
20
+
-**Alias Preview URLs**: A static, human-readable alias that you can manually assign to a Worker version.
21
+
22
+
Both preview URL types follow the format: `<VERSION_PREFIX OR ALIAS>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev`.
16
23
17
24
Preview URLs can be:
18
25
@@ -24,22 +31,65 @@ When testing zone level performance or security features for a version, we recom
24
31
25
32
:::note
26
33
Preview URLs are only available for Worker versions uploaded after 2024-09-25.
34
+
:::
35
+
36
+
## Types of Preview URLs
37
+
38
+
### Version-Prefixed Preview URLs
27
39
40
+
Every time you create a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker, a unique static version preview URL is generated automatically. These URLs use a version prefix and follow the format `<VERSION_PREFIX>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev`.
41
+
42
+
New versions of a Worker are created when you run:
- Or when you make edits via the Cloudflare dashboard
47
+
48
+
These URLs are public by default and available immediately after version creation.
49
+
50
+
:::note
28
51
Minimum required Wrangler version: 3.74.0. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/).
29
52
:::
30
53
31
-
## View preview URLs using wrangler
54
+
####View version-prefixed preview URLs using Wrangler
32
55
33
56
The [`wrangler versions upload`](/workers/wrangler/commands/#upload) command uploads a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker and returns a preview URL for each version uploaded.
34
57
35
-
## View preview URLs on the Workers dashboard
58
+
####View version-prefixed preview URLs on the Workers dashboard
36
59
37
60
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers) and select your project.
38
61
2. Go to the **Deployments** tab, and find the version you would like to view.
39
62
63
+
### Aliased Preview URLs
64
+
65
+
Aliased preview URLs let you assign a persistent, readable alias to a specific Worker version. These are useful for linking to stable previews across environments. These types of preview URLs follow the same pattern as other preview URLs:
66
+
`<ALIAS>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev`
67
+
68
+
:::note
69
+
Minimum required Wrangler version: XXXXXXXXX. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/).
70
+
:::
71
+
72
+
#### Creating an Alias
73
+
74
+
Aliases may be created by explicitly defining setting an alias during a `versions upload`:
75
+
76
+
```bash
77
+
wrangler versions upload --alias staging
78
+
```
79
+
80
+
The resulting alias would be associated with this version, and immediately available at:
81
+
`staging-<WORKER_NAME>.<SUBDOMAIN>.workers.dev`
82
+
83
+
#### Rules & Limitations
84
+
85
+
- Aliases may only be created during version upload.
86
+
- Aliases must use only lowercase letters and numbers.
87
+
- The alias and Worker name combined (with a dash) must not exceed 63 characters due to DNS label limits.
88
+
- Only the 50 most recently used aliases are retained. When a new alias is created beyond this limit, the least recently used alias is deleted.
89
+
40
90
## Manage access to Preview URLs
41
91
42
-
By default, preview URLs are enabled and available publicly. You can use [Cloudflare Access](/cloudflare-one/policies/access/) to require visitors to authenticate before accessing preview URLs. You can limit access to yourself, your teammates, your organization, or anyone else you specify in your [access policy](/cloudflare-one/policies/access).
92
+
By default, all preview URLs are enabled and available publicly. You can use [Cloudflare Access](/cloudflare-one/policies/access/) to require visitors to authenticate before accessing preview URLs. You can limit access to yourself, your teammates, your organization, or anyone else you specify in your [access policy](/cloudflare-one/policies/access).
43
93
44
94
To limit your preview URLs to authorized emails only:
45
95
@@ -67,6 +117,8 @@ You must press enter after you input your Application domain for it to save. You
67
117
68
118
## Disabling Preview URLs
69
119
120
+
Disabling Preview URLs will disable routing to both version-prefixed and aliased URLs.
0 commit comments