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
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,9 +65,42 @@ You must press enter after you input your Application domain for it to save. You
65
65
10. Go to the next page.
66
66
11. Add application.
67
67
68
-
## Making Preview URLs inaccessible
68
+
## Disabling Preview URLs
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
+
### Disabling Preview URLs in the dashboard
71
+
72
+
To disable the `workers.dev` route for a Worker:
73
+
74
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
75
+
2. Go to **Workers & Pages** and in **Overview**, select your Worker.
76
+
3. Go to **Settings** > **Domains & Routes**.
77
+
4. On "Preview URLs" click "Disable".
78
+
5. Confirm you want to disable.
79
+
80
+
### Disabling Preview URLs in `wrangler.toml`
81
+
82
+
::note
83
+
Wrangler 3.91.0 or higher is required to use this feature.
84
+
::
85
+
86
+
To disable Preview URLs for a Worker, include the following in your Worker's `wrangler.toml` file:
87
+
88
+
import { WranglerConfig } from"~/components";
89
+
90
+
<WranglerConfig>
91
+
92
+
```toml
93
+
preview_urls = false
94
+
```
95
+
96
+
</WranglerConfig>
97
+
98
+
When you redeploy your Worker with this change, Preview URLs will be disabled.
99
+
100
+
:::caution
101
+
102
+
If you disable Preview URLs in the Cloudflare dashboard but do not update your Worker's `wrangler.toml` file with `preview_urls = false`, then Preview URLs will be re-enabled the next time you publish your Worker with wrangler.
Copy file name to clipboardExpand all lines: src/content/docs/workers/configuration/routing/workers-dev.mdx
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,17 @@ All Workers are assigned a `workers.dev` route when they are created or renamed
19
19
20
20
## Disabling `workers.dev`
21
21
22
-
Review your `workers.dev` route in your Worker > **Settings** > **Domains & Routes**.
22
+
### Disabling `workers.dev` in the dashboard
23
+
24
+
To disable the `workers.dev` route for a Worker:
25
+
26
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
27
+
2. Go to **Workers & Pages** and in **Overview**, select your Worker.
28
+
3. Go to **Settings** > **Domains & Routes**.
29
+
4. On `workers.dev` click "Disable".
30
+
5. Confirm you want to disable.
31
+
32
+
### Disabling `workers.dev` in `wrangler.toml`
23
33
24
34
To disable the `workers.dev` route for a Worker, include the following in your Worker's `wrangler.toml` file:
25
35
@@ -33,13 +43,13 @@ workers_dev = false
33
43
34
44
</WranglerConfig>
35
45
36
-
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.
46
+
When you redeploy your Worker with this change, the `workers.dev` route will be disabled. Disabling your `workers.dev`route not disable Preview URLs. Learn how to [disable Preview URLs](/workers/configuration/previews/#disabling-preview-urls).
37
47
38
48
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.
39
49
40
50
:::caution
41
51
42
-
If you disable your `workers.dev` route in the Cloudflare dashboard but do not update your Worker's `wrangler.toml` file with `workers_dev = false`, the `workers.dev` route will re-enable the next time you publish your Worker.
52
+
If you disable your `workers.dev` route in the Cloudflare dashboard but do not update your Worker's `wrangler.toml` file with `workers_dev = false`, the `workers.dev` route will be re-enabled the next time you publish your Worker with wrangler.
- 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`.
116
+
- Enables use of `*.workers.dev` subdomain to deploy your Worker. If you have a Worker that is only for `scheduled` events, you can set this to `false`. Defaults to `true`. Refer to [types of routes](#types-of-routes).
0 commit comments