Cloudflare Containers
Static outbound IPs for Cloudflare Containers
Configure your container's HTTP client to send requests through QuotaGuard Shield. The destination receives them from one of your two static IPs, and Shield encrypts the connection from the container to the proxy. Register both IPs with the destination, then check the route from your deployed container.

What Cloudflare's docs say about container egress
Configure enableInternet and env on ctx.container.start() before connecting to the proxy. Cloudflare's Containers documentation describes these settings as of Dec 4, 2026.
enableInternetdefaults tofalse. With it off, only HTTP and HTTPS traffic that one of your outbound intercepts handles can leave the container. Everything else is denied. The olderContainerclass allowed Internet access by default, andstart()does not, so check this first if you migrated.- With
enableInternet: true, connections that no intercept covers reach the Internet directly, including connections on other ports. This lets the container connect to the proxy on port 9294 (Shield) or 9293 (Static). - The
envoption passes environment variables into the container when it starts. Each variable can use up to 16,000 bytes for its name and value combined. Processes you start later withexec()don't get these variables, exceptPATH, so pass them in theenvoption ofexec()too. - Store the proxy URL as a Worker secret. Read it inside the Durable Object and pass it through
start({ env: … })to the container process. The value is available inside the container, so keep it out of logs and responses. Updated credentials take effect when the container starts again.
The traffic path
Your container starts the outbound connection. The destination checks its source IP against the allowlist.
- Your container runs wherever Cloudflare places it. Configure its HTTP client or SDK through supported proxy environment variables or an explicit proxy option.
- The QuotaGuard proxy receives the connection. On Shield, that hop from your container to the proxy is TLS-encrypted. On Static, it's a plain HTTP proxy connection.
- The destination receives the call from one of the two static IPs you added to its allowlist.
Your HTTPS session with the destination is a separate inner TLS session. Neither Shield nor Static decrypts it.

Shield or Static
Start with QuotaGuard Shield to encrypt the connection between your container and the proxy with TLS, alongside your HTTPS session with the destination. Use a client that accepts an https:// proxy URL.
On the Starter plan, Static is $19 a month and Shield is $29 a month. Compare all plans on the pricing page.
Configure your container
- Create a Shield subscription in a region close to where your containers run. Cloudflare picks each instance's location, and you can narrow it with a jurisdiction on the Durable Object namespace. Your dashboard shows your two static IPs.
- Store the proxy URL as a Worker secret. The Shield URL starts with
https://and uses port 9294. Static uses anhttp://URL on port 9293. The examples below call the secretPROXY_URL. - Start the container with Internet access and the proxy variables. This example uses the
durable_objectscheduling policy with an image namedbase. Ensure outbound intercepts leave the connection to your chosen proxy available.
import { DurableObject } from "cloudflare:workers";
export class MyContainer extends DurableObject {
async startContainer() {
const container = this.ctx.container;
if (container.running) return;
container.start({
image: container.images.base,
enableInternet: true, // the default is false
env: {
HTTPS_PROXY: this.env.PROXY_URL,
HTTP_PROXY: this.env.PROXY_URL,
http_proxy: this.env.PROXY_URL,
},
});
}
}
start() returns before the container is ready to accept requests. Confirm application readiness before sending traffic. The lowercase http_proxy covers curl's HTTP destinations; uppercase HTTP_PROXY remains available for other clients.
- Check your HTTP client's proxy support. The client inside the container must support the variables or use an explicit proxy option. For Shield, it must also accept an
https://proxy URL.
- curl uses lowercase
http_proxyfor HTTP destinations andhttps_proxyorHTTPS_PROXYfor HTTPS destinations. The destination selects the variable; the proxy URL's scheme selects the proxy transport. For Shield, use a curl build with HTTPS-proxy support. Check lowercase overrides andno_proxy/NO_PROXYexclusions when verifying the route. - Python Requests reads
HTTPS_PROXYandHTTP_PROXY. - Go
net/httpreads them throughProxyFromEnvironment, which the default transport uses. - Node.js: Start Node 24.0.0+ or 22.21.0+ with
NODE_USE_ENV_PROXY=1for itsfetchto useHTTPS_PROXY, as Node's docs describe. Alternatively, pass the proxy URL to undici'sProxyAgent:
import { ProxyAgent, fetch } from "undici";
const proxy = new ProxyAgent(process.env.HTTPS_PROXY);
const res = await fetch("https://API_HOST/PATH", { dispatcher: proxy });
Configure the proxy on any vendor SDK that uses its own HTTP client, too. To route only selected calls through a static IP, configure those clients directly and leave the environment variables out.
- Allowlist both static IPs shown in your dashboard. Each subscription comes with two.
- Check the egress IP from inside your deployed container and confirm it matches a static IP from your dashboard. If you run the check with
exec(), pass the proxy variables in itsenvoption.
Use an image whose application HTTP client or SDK supports the selected proxy, including an https:// proxy URL for Shield. Verify the deployed application's egress with that same client configuration. For other platforms, see static IPs for Docker.
Cloudflare's own option: dedicated egress IPs
Cloudflare offers dedicated egress IPs through Cloudflare Gateway, as an add-on to Zero Trust Enterprise plans. They're static addresses assigned only to your account. Each one is an IPv4 address and an IPv6 range tied to a Cloudflare data center, and Cloudflare provisions at least two, in two different cities. Your account team sets them up.
They apply to traffic that Gateway proxies. For Workers, a Workers VPC binding with network_id: "cf1:network" sends fetch() calls made on that binding through Gateway, where your egress policies and dedicated egress IPs apply. Workers VPC is in beta.
If you already run Zero Trust Enterprise, that keeps everything with one provider, and your account team can confirm which of your traffic it covers.
When the call still comes from the wrong IP
- The connection to the proxy times out or is refused. Check that the container starts with
enableInternet: true. With the default offalse, only intercepted HTTP and HTTPS can leave. - The destination still sees a Cloudflare address. The client is going direct. Look for Node's
fetchwithoutNODE_USE_ENV_PROXY=1, an SDK with its own client, or a process started withexec()without the variables. - Check that the scheme and port match the product you use:
https://and port 9294 for Shield,http://and port 9293 for Static. - The source IP is one of your two static IPs. Ask the destination's owner to confirm that both addresses are allowlisted in the environment you're calling.
Keep your API keys, tokens and certificates exactly as the destination set them up. The allowlist is an additional check.
What about Workers?
For a Worker that needs to make an allowlisted call, hand the request to your Container and make the call there, or use Cloudflare's Workers VPC route above. The QuotaGuard setup here covers calls from Containers, rather than a Worker's own fetch() calls.
FAQ
Which IPs should my API provider allowlist for Cloudflare Containers?
Give the API owner both static outbound IPv4 addresses from the QuotaGuard subscription your container uses. If the allowlist requires CIDR notation, enter each address as its own /32. Use the pair from your subscription's connection details, not the proxy hostname or an address from Cloudflare.
The path is container HTTP client → QuotaGuard outbound proxy → API. The API sees one address from the pair on a given connection. If Cloudflare starts a replacement container elsewhere, that container uses the same pair as long as its client uses the same QuotaGuard proxy configuration.
Where do I put HTTPS_PROXY in a Cloudflare Container?
Pass it in env on this.ctx.container.start() inside the Durable Object. In the durable_object scheduling policy used here, the same call selects a configured image and enables outbound Internet access. Add this to your existing startup flow:
const container = this.ctx.container;
if (!container.running) {
const proxyUrl = this.env.PROXY_URL;
if (!proxyUrl) throw new Error("Missing PROXY_URL Worker secret");
container.start({
image: container.images.base,
enableInternet: true,
env: { HTTPS_PROXY: proxyUrl },
});
}
Here base is the name of a configured image and PROXY_URL is a Worker secret. Use a client that reads HTTPS_PROXY, or pass the value to the client's proxy option. Keep your readiness check before forwarding requests. See Cloudflare's startup options.
How do I keep the Shield proxy URL out of my container image and logs?
Store the complete Shield connection URL as a Worker secret, then pass only the value the container app needs at startup. The URL contains proxy credentials. Keep it out of the Dockerfile, build arguments, committed configuration, client responses and logs. For a missing-value check, log the variable name or whether it's present, never its value.
For an existing Wrangler staging environment, use npx wrangler secret put PROXY_URL --env staging and enter the URL at the prompt. Wrangler secrets are set per environment, and secret put deploys a new Worker version. For local development, put the value in an uncommitted .dev.vars or .env file next to the Wrangler config. See Wrangler environments.
Why did my container lose access to the proxy after I moved off @cloudflare/containers?
Check enableInternet in the call that actually starts the container. The old Container class enabled Internet access by default. The direct ctx.container.start() API defaults it to false. For this direct proxy setup, use enableInternet: true where your network policy permits the container to connect to the proxy.
Cloudflare's outbound intercepts send matching traffic to a Worker. They're separate from the container client's forward-proxy setting. If outbound access is governed by intercept rules, check that policy before changing it. Passing a proxy URL in env grants no network access on its own. See the migration guide.
Why does curl in my Cloudflare Container honor HTTPS_PROXY but ignore HTTP_PROXY?
On Linux, curl reads lowercase http_proxy for an http:// destination. For an https:// destination, use https_proxy or HTTPS_PROXY. If both HTTPS variants are set, lowercase wins. ALL_PROXY is a fallback when the destination's scheme has no proxy setting. NO_PROXY or no_proxy can exclude the destination even when a proxy is configured. See curl's environment variable guide.
The destination scheme selects the variable. The scheme in its value controls the connection to the proxy. For an HTTPS API, use Shield's dashboard https:// URL on 9294, or Static's http:// URL on 9293. For Shield, check that your curl build supports HTTPS proxies. See supported TLS backends.
How do I route Node.js fetch() through Shield inside the container?
For selected calls, import fetch and ProxyAgent from undici and pass the agent as the dispatcher. Use the complete Shield URL supplied to the Node process as HTTPS_PROXY. This example uses Undici 8.0.0, whose package requires Node.js 22.19.0 or later.
import { fetch, ProxyAgent } from "undici";
const proxyUrl = process.env.HTTPS_PROXY;
if (!proxyUrl) throw new Error("Missing HTTPS_PROXY");
const dispatcher = new ProxyAgent(proxyUrl);
export function fetchThroughShield(url, init = {}) {
return fetch(url, { ...init, dispatcher });
}
Reuse the dispatcher in your app and call this function with a destination URL from server-side configuration. Calls using this dispatcher take the proxy route; a separate SDK client needs its own configuration. See Undici's ProxyAgent examples.
If you're using Node's built-in fetch() with environment-based proxying instead, Node documents NODE_USE_ENV_PROXY=1 at startup starting with 24.0.0 on the 24.x line and 22.21.0 on the 22.x line. Pass the flag as part of the container process's startup environment. The explicit dispatcher above needs no such flag. See Node's network configuration guide.
Why does curl use the proxy but my Python or Go client still goes direct?
Check the client that sends the API request, not just the container's environment. A successful curl request tells you that curl can use the proxy. It doesn't tell you which settings your SDK uses.
- Python Requests: Check whether the SDK sets
Session.trust_envtoFalseor supplies its ownproxiesmapping. Also check the destination against the bypass list. For an HTTPS request you control, passproxies={"https": proxy_url}explicitly. See Requests' proxy settings. - Go
net/http: The default transport usesProxyFromEnvironment. A customhttp.TransportwithProxy: nilgoes direct. SetProxy: http.ProxyFromEnvironmentto use the environment, orProxy: http.ProxyURL(parsedProxyURL)on a client just for the partner API. If using the environment, checkNO_PROXYfor the destination. See Go's transport docs.
Does the container's proxy setting also cover my Worker's fetch() or incoming webhooks?
It covers outgoing calls made by the HTTP client you configured inside the container. If a Worker currently makes the partner API call itself, have it invoke your container through the Durable Object, then make the partner call from the container's HTTP client. Cloudflare's request lifecycle shows where that handoff happens.
For an incoming webhook, the sender initiates the connection to your Worker. Keep that inbound route and its authentication separate. If the webhook handler then calls an allowlisted API, that follow-up call is the outbound leg to route through the proxy.
Why is HTTPS_PROXY missing when I run a diagnostic with ctx.container.exec()?
exec() starts a separate process. It inherits PATH, but not the other variables supplied by start({ env: ... }). For a curl diagnostic, pass the Worker secret as HTTPS_PROXY in exec()'s own env option. That keeps the secret out of the command arguments.
From the Durable Object, with the container already running and curl in its image:
const proxyUrl = this.env.PROXY_URL;
if (!proxyUrl) throw new Error("Missing PROXY_URL Worker secret");
const probe = await this.ctx.container.exec(
["curl", "--fail", "--silent", "--show-error", "--max-time", "10",
"https://ip.quotaguard.com"],
{ env: { HTTPS_PROXY: proxyUrl } },
);
const { exitCode, stdout } = await probe.output();
if (exitCode !== 0) throw new Error("Container IP check failed");
const { ip } = JSON.parse(new TextDecoder().decode(stdout));
Compare ip with the two addresses in your subscription. This checks curl's route. Verify the API route with the client and configuration your app actually uses. See Cloudflare's exec() contract.
How do I confirm the deployed container sends requests from my static IPs?
From the deployed container, send an HTTPS GET to the QuotaGuard IP check with the same client and proxy settings used for the partner call. Read the ip field from the JSON response. It should match either of the two addresses for that subscription. Use a test call with no partner API token or other application credentials.
Seeing the same address repeatedly is fine. The egress address is selected per connection, so repeated requests on one connection can show the same IP. If the result is outside the pair, check the client's proxy settings and any bypass rules.
An echo match proves that request's egress, not the route for another hostname. Check the rules for the partner hostname too, then make one documented read-only call in the environment where the pair is allowlisted.
My Cloudflare Container sees a 407 on CONNECT or a 403 from the API. What should I check?
A 407 Proxy Authentication Required on CONNECT comes from the proxy step. Some clients surface that as a tunnel error rather than an API response. Check that the subscription is active and that the running container uses its current connection URL. See QuotaGuard's 407 troubleshooting guide if the subscription is suspended.
For a 401 or 403 returned by the API after the tunnel opens, check the provider's error body, token scope and environment. Confirm both IPs are on that environment's allowlist. A 403 alone doesn't tell you whether the IP, credentials or another API policy caused the refusal.
Which certificate should I check when Shield requests fail with a TLS error?
Check which TLS handshake failed. Shield encrypts the hop from the container to the proxy. For an HTTPS destination, the client then opens a separate TLS session to the API inside the CONNECT tunnel. The API payload stays encrypted end to end on both Shield and Static; Shield also protects the first hop.
For a proxy-side TLS error, check the Shield URL's https:// scheme, hostname and port 9294, and the CA trust available to the client in the image. For a destination-side TLS error, check the API hostname and its certificate chain.
If you use curl, --proxy-cacert selects a CA bundle for the proxy and --cacert selects one for the API. Keep certificate and hostname validation enabled for both. See curl's TLS verification guide.
I updated the Worker secret. How do I get running containers to pick it up?
For this startup-based setup, apply the Worker secret change and bring up fresh container processes with the new value in start({ env: ... }). Treat that value as set at process start. In particular, a startup guard that returns when container.running is true leaves that instance running with its existing environment.
For the durable_object scheduling policy, your application controls stop and start. Restart instances in a controlled order, wait for the app's readiness check, then verify egress from the replacement instance. Check each instance you serve through rather than assuming one successful probe covers the whole fleet. See Cloudflare's container lifecycle and shutdown controls.
Give your Cloudflare Containers a fixed IP
Set up Shield, pass the proxy URL to your container's HTTP client, and check the source IP from inside the container.