Skip to content

Preview URLs

Beta

Preview URLs allow you to preview new versions of your Worker without deploying it to production.

Every time you create a new version of your Worker a unique preview URL is generated. Preview URLs take the format: <VERSION_PREFIX>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev. New versions of a Worker are created on wrangler deploy, wrangler versions upload or when you make edits on the Cloudflare dashboard. By default, preview URLs are enabled and available publicly.

Preview URLs can be:

  • Integrated into CI/CD pipelines, allowing automatic generation of preview environments for every pull request.
  • Used for collaboration between teams to test code changes in a live environment and verify updates.
  • Used to test new API endpoints, validate data formats, and ensure backward compatibility with existing services.

When testing zone level performance or security featues for a version, we recommended using version overrides so that your zone’s performance and security settings apply.

View preview URLs using wrangler

The wrangler versions upload command uploads a new version of your Worker and returns a preview URL for each version uploaded.

View preview URLs on the Workers dashboard

  1. Log in to the Cloudflare dashboard and select your project.
  2. Head to the “Deployments” tab find the version you would like to view.

Manage access to Preview URLs

By default, preview URLs are enabled and available publicly. You can use Cloudflare Access to require visitors to authenticate before accessing preview URLs. You can limit access to yourself, your teammates, your organization, or anyone else you specify in your access policy.

To limit your preview URLs to authorized emails only:

  1. Log in to the Cloudflare Access dashboard.
  2. Select your account.
  3. Add an application.
  4. Select Self Hosted.
  5. Name your application (for example, “my-worker”) and add your workers.dev subdomain as the Application domain.

For example, if you want to secure preview URLs for a Worker running on my-worker.my-subdomain.workers.dev.

  • Subdomain: *-my-worker
  • Domain: my-subdomain.workers.dev
  1. Go to the next page.
  2. Add a name for your access policy (for example, “Allow employees access to preview URLs for my-worker”).
  3. 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.
  4. Enter the emails you want to authorize. View access policies to learn about configuring alternate rules.
  5. Go to the next page.
  6. Add application.

Making Preview URLs inaccessible

Preview URLs run on your workers.dev subdomain. To make preview URLs inaccessible, you must disable your Workers workers.dev subdomain. Learn how to disable your Workers workers.dev subdomain.

Limitations