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
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,17 +60,42 @@ You must press enter after you input your Application domain for it to save. You
60
60
61
61
6. Go to the next page.
62
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.
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
64
9. Enter the emails you want to authorize. View [access policies](/cloudflare-one/policies/access/#selectors) to learn about configuring alternate rules.
65
65
10. Go to the next page.
66
66
11. Add application.
67
67
68
68
## Making Preview URLs inaccessible
69
69
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).
70
+
Preview URLs run on your [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/). You can disable preview URLs to make them inaccessible.
71
+
72
+
### Disable on the Cloudflare dashboard
73
+
74
+
1. Log into the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
75
+
2. Go to **Workers** > your Worker.
76
+
3. Go to **Settings**.
77
+
4. In the "Domains & Routes" section click "Disable" on "Preview URLs".
78
+
5. Confirm you want to disable.
79
+
80
+
### Disable in Wrangler
81
+
82
+
::note
83
+
Wrangler vXX or higher is required to use this feature.
84
+
::
85
+
86
+
In your `wrangler.toml` you can add `preview_urls = false` to disable preview URLs from being accessible.
87
+
88
+
```toml
89
+
name = "my-worker"
90
+
compatibility_date = "2024-01-01"
91
+
preview_urls = false
92
+
```
93
+
94
+
This will be applied when doing `wrangler deploy` or `wrangler triggers deploy` if using [Gradual Deployments](/workers/configuration/versions-and-deployments/gradual-deployments).
71
95
72
96
## Limitations
73
97
74
98
- Preview URLs are not generated for Workers that implement a [Durable Object](/durable-objects/).
75
99
- 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.
76
100
- You cannot currently configure Preview URLs to run on a subdomain other than [`workers.dev`](/workers/configuration/routing/workers-dev/).
101
+
- You cannot use `wrangler tail`, [Workers Logs](/workers/observability/logs/workers-logs) or other similar tools to view logs for preview URLs.
Copy file name to clipboardExpand all lines: src/content/docs/workers/configuration/routing/workers-dev.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,8 @@ To disable the `workers.dev` route for a Worker, include the following in your W
27
27
workers_dev = false
28
28
```
29
29
30
-
When you redeploy your Worker with this change, the `workers.dev` route will be disabled. Disabling your `workers.dev` subdomain will also make [preview URLs](/workers/configuration/previews) inaccessible.
30
+
When you redeploy your Worker with this change, the `workers.dev` route will be disabled.
31
+
Disabling your `workers.dev` subdomain will not make [preview URLs](/workers/configuration/previews) inaccessible, to do that [see here](/workers/configuration/previews/#making-preview-urls-inaccessible).
31
32
32
33
If you do not specify `workers_dev = false` but add a [`routes` component](/workers/wrangler/configuration/#routes) to your `wrangler.toml`, the value of `workers_dev` will be inferred as `false` on the next deploy.
Copy file name to clipboardExpand all lines: src/content/docs/workers/wrangler/configuration.mdx
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,10 @@ At a minimum, the `name`, `main` and `compatibility_date` keys are required to d
108
108
109
109
- Enables use of `*.workers.dev` subdomain to test and deploy your Worker. If you have a Worker that is only for `scheduled` events, you can set this to `false`. Defaults to `true`.
0 commit comments