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/workers/configuration/previews.mdx
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ import { Render } from "~/components";
12
12
13
13
Preview URLs allow you to preview new versions of your Worker without deploying it to production.
14
14
15
-
Every time you create a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker a unique preview URL is generated. 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.
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.
16
16
17
17
Preview URLs can be:
18
18
@@ -24,6 +24,8 @@ When testing zone level performance or security featues for a version, we recomm
24
24
25
25
:::note
26
26
Preview URLs are only available for Worker versions uploaded after 2024-09-25.
27
+
28
+
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/).
27
29
:::
28
30
29
31
## View preview URLs using wrangler
@@ -35,6 +37,34 @@ The [`wrangler versions upload`](/workers/wrangler/commands/#upload) command upl
35
37
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers) and select your project.
36
38
2. Head to the "Deployments" tab find the version you would like to view.
37
39
40
+
## Manage access to Preview URLs
41
+
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).
43
+
44
+
To limit your preview URLs to authorized emails only:
45
+
46
+
1. Log in to the [Cloudflare Access dashboard](https://one.dash.cloudflare.com/?to=/:account/access/apps).
47
+
2. Select your account.
48
+
3. Add an application.
49
+
4. Select **Self Hosted**.
50
+
5. Name your application (for example, "my-worker") and add your `workers.dev` subdomain as the **Application domain**.
51
+
52
+
For example, if you want to secure preview URLs for a Worker running on `my-worker.my-subdomain.workers.dev`.
53
+
54
+
- Subdomain: `*-my-worker`
55
+
- Domain: `my-subdomain.workers.dev`
56
+
57
+
:::note
58
+
You must press enter after you input your Application domain for it to save. You will see a "Zone is not associated with the current account" warning that you may ignore.
59
+
:::
60
+
61
+
6. Go to the next page.
62
+
7. Add a name for your access policy (for example, "Allow employees access to preview URLs for my-worker").
63
+
8. In the **Configure rules** section create a new rule with the **Emails** selector, or any other attributes which you wish to gate access to previews with.
64
+
9. Enter the emails you want to authorize. View [access policies](/cloudflare-one/policies/access/#selectors) to learn about configuring alternate rules.
65
+
10. Go to the next page.
66
+
11. Add application.
67
+
38
68
## Making Preview URLs inaccessible
39
69
40
70
Preview URLs run on your [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/). To make preview URLs inaccessible, you must disable your Workers `workers.dev` subdomain. Learn how to [disable your Workers `workers.dev` subdomain](/workers/configuration/routing/workers-dev/#disabling-workersdev).
@@ -43,4 +73,3 @@ Preview URLs run on your [`workers.dev` subdomain](/workers/configuration/routin
43
73
44
74
- Preview URLs are not generated for Workers that implement a [Durable Object](/durable-objects/).
45
75
- Preview URLs are not currently generated for [Workers for Platforms](/cloudflare-for-platforms/workers-for-platforms/)[user Workers](/cloudflare-for-platforms/workers-for-platforms/reference/how-workers-for-platforms-works/#user-workers). This is a temporary limitation, we are working to remove it.
46
-
- You cannot currently secure `workers.dev` URLs behind [Cloudflare Access](/cloudflare-one/policies/access/). This is a temporary limitation, we are working to remove it.
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/nextjs.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,10 @@ To create a new Next.js app, pre-configured to run on Cloudflare using [`@openne
38
38
39
39
Check your version by running `wrangler version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/).
40
40
41
+
:::note
42
+
43
+
Minimum required Wrangler version: 3.78.10. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/).
0 commit comments