OpenAICloudflare Developer PlatformJun 5, 2026, 12:00 AM

Gateway, Cloudflare Mesh, Workers VPC - Filter Workers' public Internet traffic using Gateway policies

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Gateway, Cloudflare Mesh, Workers VPC - Filter Workers' public Internet traffic using Gateway policies

Key Points

  • Worker egress routed via Gateway
  • Gateway DNS/HTTP/Network policies apply
  • Worker traffic appears in Gateway logs

Summary

Cloudflare Workers that use a VPC Network binding (network_id: "cf1:network") now egress to the public Internet through Cloudflare Gateway. Worker-originated traffic is subject to the same Zero Trust Gateway policies (DNS, HTTP, Network) as WARP users and is logged for visibility and auditing.

Key Points

  • Enable egress: add a VPC network binding in wrangler with binding: "EGRESS", network_id: "cf1:network", remote: true.
{
  "vpc_networks": [
    {
      "binding": "EGRESS",
      "network_id": "cf1:network",
      "remote": true
    }
  ]
}
[[vpc_networks]]
binding = "EGRESS"
network_id = "cf1:network"
remote = true
  • Usage: call env.EGRESS.fetch("https://api.example.com/data") from your Worker; the request is routed through Gateway and subject to policies.
const response = await env.EGRESS.fetch("https://api.example.com/data");
  • Enforcement: existing Gateway DNS, HTTP, and Network policies (allow/block lists, DNS category filtering, HTTP destination rules) apply to Worker egress.
  • Observability: Worker egress appears in Gateway DNS, HTTP, and Network logs so you can audit destinations and times.

For configuration options see the VPC Networks docs and for policy authoring see Cloudflare Gateway traffic policies.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Gateway、Cloudflare Mesh、Workers VPC — Gatewayポリシーを使用してWorkersの公開インターネットトラフィックをフィルタリングする

Gateway、Cloudflare Mesh、Workers VPC — Gatewayポリシーを使用してWorkersの公開インターネットトラフィックをフィルタリングする

Workersがnetwork_id: "cf1:network" を持つVPC Networkバインディングを使用する場合、Cloudflare Gateway経由でパブリックインターネット先へのイグレスが行われるようになりました。これにより、既存のZero Trustトラフィックポリシー(DNS、HTTP、Network、およびegress)が、WARPユーザーと同様にWorkers発のトラフィックにも適用されます。

  • Workerが呼び出し: env.EGRESS.fetch()

  • VPCバインディング ↓

  • Cloudflare Mesh(Bind via cf1:network) ↓

  • Cloudflare Gateway(ポリシー適用: DNS / HTTP / Network) ↓ ↗ Public Internet(任意の公開ホスト名またはIP)

  • Gatewayログ: DNS / HTTP / Network

    Worker Calls env.EGRESS.fetch() VPC binding ↓ Cloudflare Mesh Bind via cf1:network ↓ Cloudflare Gateway Policies applied: DNS HTTP Network ↓ ↗ Public Internet Any public hostname or IP Gateway logs DNS HTTP Network

既定で得られるもの:

  • 可視性(Visibility)

    • WorkerのイグレスはGatewayのDNS、HTTP、Networkログに表示され、他のトラフィックと同様にWorkersがいつ何にアクセスしたかを監査できます。
  • 強制(Enforcement)

    • ワーカーリクエストに一致するセレクタを持つ既存のGatewayポリシー(allow / block リスト、DNSカテゴリフィルタリング、HTTP宛先ルールなど)はそのまま適用されます。組織の従業員向けに既にカテゴリをブロックしている場合、Workersはそのブロックを継承します。

設定例:

wrangler.jsonc

{
  " vpc_networks " : [
    {
      " binding " : "EGRESS" ,
      " network_id " : "cf1:network" ,
      " remote " : true ,
    },
  ],
}

wrangler.toml

[[ vpc_networks ]]
binding = "EGRESS"
network_id = "cf1:network"
remote = true

JavaScript / TypeScript

// Egress to a public destination — subject to your Gateway policies and logged
const response = await env . EGRESS . fetch ( "https://api.example.com/data" ) ;

// TypeScript
// Egress to a public destination — subject to your Gateway policies and logged
const response = await env . EGRESS . fetch ( "https://api.example.com/data" ) ;

設定オプションについては VPC Networks を参照してください。ポリシー作成については Cloudflare Gateway traffic policies を参照してください。

リソース:

  • API
  • Help Center
  • System Status
  • Compliance / GDPR
  • cloudflare.com(Our team、Careers など)
  • Tools: Cloudflare Radar、Cloudflare Labs、Speed Test
  • Community: Community forum、X、Discord、YouTube、GitHub

© 2026 Cloudflare, Inc. Privacy Policy Terms of Use Report Security Issues Trademark Cookie Settings

Was this helpful? Yes / No

Gateway, Cloudflare Mesh, Workers VPC - Filter Workers' public Internet traffic using Gateway policies | Cloudflare Developer Platform | DocsDigest