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/previews/index.mdx
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,79 @@ Workers Builds posts both URLs as a comment on your pull request. `wrangler prev
146
146
147
147
---
148
148
149
+
## Enable or disable Preview URLs
150
+
151
+
You control whether Preview URLs are active through the `previews_enabled` setting on your Worker's subdomain configuration. By default, `previews_enabled` follows the state of your `workers.dev` subdomain -- if you disable your `workers.dev` route, Preview URLs are also disabled unless you explicitly enable them.
152
+
153
+
You can toggle this through the dashboard, the API, or your Wrangler configuration file:
154
+
155
+
<WranglerConfig>
156
+
157
+
```toml
158
+
# Explicitly enable Preview URLs
159
+
preview_urls = true
160
+
```
161
+
162
+
</WranglerConfig>
163
+
164
+
For step-by-step instructions, refer to [Toggle Preview URLs](/workers/configuration/routing/workers-dev/).
165
+
166
+
---
167
+
168
+
## Use a custom domain for Previews
169
+
170
+
You can serve Previews from your own custom domain instead of (or in addition to) `workers.dev`. When you enable Previews on a custom domain, Cloudflare creates a wildcard DNS record and adds a wildcard SAN to the domain's certificate to cover all Preview subdomains.
You can also disable production routing on a custom domain while keeping Previews active by setting `production_enabled` to `false` -- this serves only Preview traffic on that domain.
207
+
208
+
---
209
+
210
+
## Secure access to Previews
211
+
212
+
To restrict who can access your Preview URLs, you can enable [Cloudflare Access](/cloudflare-one/access-controls/policies/) with a single click in your Worker's settings. This protects both Preview URLs and Deployment URLs.
213
+
214
+
1. Go to **Workers & Pages** > your Worker > **Settings** > **Domains & Routes**.
215
+
2. For Preview URLs, select **Enable Cloudflare Access**.
216
+
3. Optionally, select **Manage Cloudflare Access** to configure which users, groups, or email addresses are authorized.
217
+
218
+
For more information on configuring access policies, refer to [Access policies](/cloudflare-one/access-controls/policies/).
219
+
220
+
---
221
+
149
222
## Observability and logging
150
223
151
224
Each Preview runs its own observability and logging settings, independent of your production Worker. This means you can:
0 commit comments