Skip to content

Workers

Last updated View as MarkdownAgent setup

To ensure that your Cloudflare Workers code runs only within a specific geographic region, configure Regional Services on the Workers custom domain. This restricts where TLS termination (traffic decryption) and code execution occur.

Regional Services

To configure Regional Services for hostnames proxied (meaning traffic routes through Cloudflare rather than directly to your origin server) through Cloudflare and ensure that processing of a Workers project occurs only in-region, follow these steps:

  1. In the Cloudflare dashboard, go to the Workers & Pages page.

    Go to Workers & Pages ↗
  2. Select your Workers project.

  3. Follow the steps to create a custom domain.

  4. Run the API POST command on the configured Workers Custom Domain to create a regional_hostnames with a specific region.

Caveats

Regional Services only applies to the custom domain configured for a Workers project. Therefore, it will run only in-region Cloudflare locations.

Regional Services restricts where Workers are executed (where requests are processed). However, Workers code and secrets are deployed globally to all Cloudflare data centers. Regional Services does not prevent the code itself from being present outside the configured region — only its execution is regionalized.

Requests reaching your regionalized hostname from another zone or domain are regionalized according to your hostname's Regional Services configuration, regardless of the originating zone. Regional Services does not extend to outgoing subrequests from Workers to other services — refer to Limitations for details.

Regional Services does not apply to other Worker triggers, like Queues or Cron Triggers.

Customer Metadata Boundary

Customer Metadata Boundary applies to the custom domain configured, as well as the *.workers.dev subdomain.

Workers Metrics and Analytics are not available outside the US region when using Customer Metadata Boundary.

With Customer Metadata Boundary set to EU, Workers & Pages > Workers > Metrics tab the zone dashboard will not be populated.

Refer to the Workers documentation for more information.

Was this helpful?