Skip to content

Commit cf348d2

Browse files
committed
[Workers] Document preview_urls config
1 parent 823f28a commit cf348d2

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

src/content/docs/workers/configuration/previews.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,24 @@ You must press enter after you input your Application domain for it to save. You
6767

6868
## Making Preview URLs inaccessible
6969

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+
To make preview URLs inaccessible for a Worker, include the following in your Worker's `wrangler.toml` file:
71+
72+
import { WranglerConfig } from "~/components";
73+
74+
<WranglerConfig>
75+
76+
```toml
77+
preview_urls = false
78+
```
79+
80+
</WranglerConfig>
81+
82+
When you redeploy your Worker with this change, Preview URLs will be disabled.
83+
84+
:::caution
85+
86+
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.
87+
:::
7188

7289
## Limitations
7390

src/content/docs/workers/configuration/routing/workers-dev.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ workers_dev = false
3333

3434
</WranglerConfig>
3535

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.
36+
When you redeploy your Worker with this change, the `workers.dev` route will be disabled.
3737

3838
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.
3939

4040
:::caution
4141

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.
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 be re-enabled the next time you publish your Worker with wrangler.
4343
:::
4444

4545
## Limitations

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ At a minimum, the `name`, `main` and `compatibility_date` keys are required to d
113113

114114
- `workers_dev` <Type text="boolean" /> <MetaInfo text="optional" />
115115

116-
- 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).
117+
118+
- `preview_urls` <Type text="boolean" /> <MetaInfo text="optional" />
119+
120+
- Enables use of Preview URLs to test your Worker. Defaults to `true`. Refer to [Preview URLs](/workers/configuration/previews).
117121

118122
- `route` <Type text="Route" /> <MetaInfo text="optional" />
119123

0 commit comments

Comments
 (0)