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/changelog/workers/2025-10-23-preview-url-default-behavior.mdx
+21-5Lines changed: 21 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,32 @@ title: Workers Preview URL default behavior now matches your workers.dev setting
3
3
description: If a Workers Preview URL setting is not explicitly configured, its default behavior will now match the setting of the workers.dev subdomain.
4
4
date: 2025-10-23
5
5
---
6
-
We have updated the default behavior for Cloudflare Workers [Preview URLs](/workers/configuration/previews/). Going forward, if a preview URL setting is not [explicitly configured](/workers/configuration/previews/#toggle-preview-urls-enable-or-disable) during deployment, its default behavior will automatically match the setting of your `[workers.dev` subdomain](/workers/configuration/routing/workers-dev/).
6
+
We have updated the default behavior for Cloudflare Workers [Preview URLs](/workers/configuration/previews/). **Going forward, if a preview URL setting is not [explicitly configured](/workers/configuration/previews/#toggle-preview-urls-enable-or-disable) during deployment, its default behavior will automatically match the setting of your [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/).**
7
7
8
8
This change is intended to provide a more intuitive and secure experience by aligning your preview URL's default state with your `workers.dev` configuration to prevent cases where a preview URL might remain public even after you disabled your `workers.dev` route.
9
9
10
-
Here is how the new default logic works:
10
+
**What this means for you:**
11
+
-**If neither setting is configured:** both the workers.dev route and the preview URL will default to enabled
12
+
-**If your workers.dev route is enabled and no preview URL is set:** Preview URLs will default to enabled
13
+
-**If your workers.dev route is disabled and no preview URL is set:** Preview URLs will default to disabled
11
14
12
-
- If your `workers.dev` route is enabled (or not configured) and no preview URL is set, Preview URLs will default to enabled.
15
+
You can override the default setting by explicitly enabling or disabling the preview URL in your Worker's configuration through the [API](/api/resources/workers/subresources/scripts/subresources/subdomain/), [Dashboard](/workers/configuration/previews/#from-the-dashboard), or [Wrangler](/workers/configuration/previews/#from-the-wrangler-configuration-file).
13
16
14
-
- If your `workers.dev` route is disabled and no preview URL is set, Preview URLs will default to disabled.
17
+
**Wrangler Version Behavior**
18
+
The default behavior depends on the version of Wrangler you are using. This new logic applies to the latest version. Here is a summary of the behavior across different versions:
19
+
- Before v4.34.0: Preview URLs defaulted to enabled, regardless of the workers.dev setting.
20
+
- v4.34.0 up to the latest version: Preview URLs defaulted to disabled, regardless of the workers.dev setting.
21
+
- Latest version: Preview URLs now default to matching your workers.dev setting.
15
22
16
-
You can override the default setting by explicitly enabling or disabling the preview URL in your Worker's configuration through the [API](/api/resources/workers/subresources/scripts/subresources/subdomain/), [Dashboard](/workers/configuration/previews/#from-the-dashboard), or [Wrangler](/workers/configuration/previews/#from-the-wrangler-configuration-file). This new logic applies when deploying with the latest version of Wrangler.
23
+
**Why we’re making this change**
24
+
In July, we introduced preview URLs to Workers, which let you preview code changes before deploying to production. This made disabling your Worker’s workers.dev URL an ambiguous action — the preview URL, served as a subdomain of `workers.dev` (ex: `preview-id-worker-name.account-name.workers.dev`) would still be live even if you had disabled your Worker’s `workers.dev` route. If you misinterpreted what it meant to disable your `workers.dev` route, you might unintentionally leave preview URLs enabled when you didn’t mean to, and expose them to the public Internet.
25
+
26
+
To address this, we made a one-time update to disable preview URLs on existing Workers that had their workers.dev route disabled and changed the default behavior to be disabled for all new deployments where a preview URL setting was not explicitly configured.
27
+
28
+
While this change helped secure many customers, it was also disruptive for customers who keep their `workers.dev` route enabled and actively use the preview functionality, as it now required them to explicitly enable preview URLs on every redeployment.
29
+
T
30
+
his new, more intuitive behavior ensures that your preview URL settings align with your `workers.dev` configuration by default, providing a more secure and predictable experience.
31
+
32
+
**Securing access to `workers.dev` and preview URL endpoints**
17
33
18
34
To further secure your `workers.dev` subdomain and preview URL, you can [enable Cloudflare Access with a single click](/changelog/2025-10-03-one-click-access-for-workers/) in your Worker's settings to limit access to specific users or groups.
0 commit comments