Zitadel behind Nginx, Traefik or Caddy with HTTP/2

Put Zitadel behind a reverse proxy, WAF or CDN with HTTP/2 and h2c for gRPC, correct Host and Forwarded headers and a TLS mode you can verify.

On this page

Why Zitadel behind Nginx, Traefik or Caddy with HTTP/2 needs planning

A platform team that already runs an edge in its own infrastructure will usually want self-hosted Zitadel behind that same layer, not a new public entry point. The proxy has three jobs that need deliberate planning: terminate TLS for the public address, pass HTTP/2 and gRPC to Zitadel's API as h2c (cleartext HTTP/2) on the upstream side, and forward the Host and Forwarded headers so Zitadel can resolve the correct instance and organization. If any one of these is wrong, login may still appear to work while API calls, console pages or instance routing fail in ways that are harder to trace.

Teams usually need this setup for a small set of reasons: an existing edge standard that every internal service must use, a WAF or CDN that the security team requires in front of all identity endpoints, or a Kubernetes ingress or Gateway API layer that already routes traffic into the cluster. Each reason adds constraints on which proxy features can be used and where TLS ends. Before choosing Nginx, Traefik or Caddy, confirm which of these apply and who owns each layer, because the answer determines whether the proxy or Zitadel itself holds the certificates for the public domain.

Zitadel documents its own domain settings, including the external domain, port and whether the external address is served over TLS, and these values must match the public address that users and clients see. A mismatch between what the proxy presents and what Zitadel expects is a common source of redirect loops and instance lookup errors. Confirm these settings against the current self-hosting documentation for your Zitadel version and treat any proxy configuration as something your own team validates in a test environment, since DeployOpen has not published tested configurations for these proxies.

Choosing Nginx, Traefik or Caddy for your edge

If your organization already runs Nginx at the edge, the lowest-friction path is usually to add a Zitadel server block to the configuration your operators already maintain. Your team keeps one set of certificates, logging formats, reload procedures and security reviews. The trade-off is that gRPC and HTTP/2 upstream settings must be written by hand, and you must keep them aligned with the Zitadel listener and its h2c expectations.

  • Familiar operations: Existing runbooks, monitoring and change control apply without new tooling.
  • Manual upstream settings: You write the gRPC and HTTP/2 directives yourself and test them against your Zitadel version.
  • Header handling: You set Host and forwarded headers explicitly, which matters for correct external domain behavior.
  • Certificate workflow: Certificates come from your existing process, such as an internal CA or an ACME client you already operate.
  • Team skills: Choose this path when engineers can already debug Nginx under load.

Before you commit, confirm in the Nginx documentation for your installed version how gRPC and HTTP/2 upstream directives behave, and test the Zitadel console and API paths end to end.

How a browser, gRPC client and the proxy reach Zitadel

The path starts with a browser or an API client sending requests to an optional CDN or WAF, which forwards them to the reverse proxy. The proxy terminates public TLS and is the trust boundary: it decides which headers Zitadel can trust and which upstream protocol it uses. From the proxy, HTTP/2 or h2c carries gRPC and API traffic to the Zitadel API and the login service, and both read and write PostgreSQL. Check the Host and Forwarded headers at the proxy first, because a mismatch there is the most common cause of routing errors.

Request path from client through CDN or WAF and proxy to Zitadel services.

Proxy options and the settings each one changes

This table compares the proxy decisions that change how Zitadel receives traffic: where TLS ends, which protocol the proxy speaks to Zitadel, which headers it forwards and whether console assets are compressed. Read each row against the option you are considering, then check that the public domain, port and secure flag Zitadel advertises match what clients actually reach at the edge.

DecisionOptionTrade-offWhen to choose it
TLS terminationTerminate TLS at the edge, plain HTTP or h2c to ZitadelSimplest certificate handling, but traffic inside the cluster or network is unencryptedSingle-host or tightly controlled private networks where the edge and Zitadel share a trusted segment
TLS terminationEnd-to-end TLS from the proxy to ZitadelEncrypts the internal hop and needs certificates and trust configuration on both sidesMulti-tenant clusters, regulated environments or when internal traffic must be encrypted by policy
Upstream protocol for gRPCHTTP/2 with h2c (cleartext) to ZitadelRequired for gRPC-based API calls to pass through without TLS; the proxy must be configured to speak HTTP/2 upstreamWhen the proxy and Zitadel communicate on a trusted network and gRPC or the APIs must work through the proxy
Upstream protocol for gRPCHTTP/1.1 upstreamWorks for the console and login pages but cannot carry gRPC traffic, so API clients failOnly when you have confirmed that no gRPC client depends on the path and have tested each route
Host headerForward the original Host header unchangedZitadel resolves the instance from the host name, so a rewritten host can produce an Instance not found errorDefault choice for most deployments; confirm against your custom domain settings
Forwarded headersSet X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-For at the edgeZitadel needs the external scheme and host to build correct URLs; untrusted clients must not be able to set these headersAny setup where the proxy is the only ingress point and overwrites client-supplied values
Console asset compressionCompress static console assets at the proxy (gzip or Brotli)Reduces transfer size for the console but adds CPU load at the edge and can complicate caching if misconfiguredBrowser-facing consoles on slow links or where the proxy already compresses other static content
Console asset compressionLeave compression to Zitadel or disable it at the proxyAvoids double-compression issues and keeps the edge simpler, with larger transfersWhen you have not verified how the proxy and Zitadel handle encoding together
External domain settingsExternalDomain, ExternalPort and ExternalSecure must match the public addressA mismatch causes redirect loops, broken login callbacks and wrong issuer URLs; see the custom domains and Instance not found guidanceEvery deployment; set these before issuing tokens or onboarding applications

Setup sequence for the proxy in front of Zitadel

This sequence takes a self-hosted Zitadel from a correct external domain to a proxy that serves the API, Login and Console over TLS with HTTP/2 upstreams, forwarded headers and compressed console assets. Each step ends with a check you can run before moving on.

  1. Confirm the external domain and TLS settings

    Before anything else, decide the public hostname users and applications will call, the external port, and whether the public side is HTTPS. Set ExternalDomain, ExternalPort and ExternalSecure in the Zitadel configuration to match what the proxy will present to browsers, not the internal address of the container or host. Your platform or infrastructure lead owns the decision, and DeployOpen can review it with your team. Done means the values are written down, match the DNS record you plan to publish, and nothing in the configuration still points at an internal name. Confirm the exact configuration keys against the version you are installing, since they are documented in the Zitadel self-hosting guidance.

  2. Run Zitadel setup with the final external settings

    Run the Zitadel setup phase only after the external domain settings are final, because the setup phase writes instance configuration that is awkward to correct later. Use the setup command for your deployment method (binary, Docker Compose or Helm) with the same configuration file the running service will read. Check the setup output for errors about the database connection or the masterkey, and confirm the database schema was created. Done means setup completes without errors and the instance is reachable on its internal address before any proxy is in front of it. If you change the external domain later, plan to rerun setup and review the custom domain guidance first.

  3. Configure the upstream for HTTP/2 or h2c

    Point the proxy at the Zitadel API and Login endpoints using HTTP/2 to the upstream. gRPC calls require HTTP/2, so the proxy must speak HTTP/2 to the backend, either over TLS or as cleartext h2c on a trusted internal network. Use separate routes for the API and the Login application if your deployment separates them, and keep the Console and gRPC paths on the same protocol expectations. Nginx, Traefik and Caddy each have their own directive for upstream protocol, so confirm the directive for your chosen proxy and version against its documentation. Done means the proxy configuration validates and a test request to the backend reports HTTP/2 when you query it directly.

  4. Forward Host and Forwarded headers

    Configure the proxy to pass the original Host header and standard forwarding headers (Forwarded or X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host) to Zitadel. Zitadel resolves the requested instance from the host it receives, so a rewritten or missing Host header is the most common cause of an instance lookup failure. Restrict which proxy addresses Zitadel trusts for these headers so clients cannot spoof them. Done means a request sent to the public hostname reaches Zitadel with the public host intact, which you can confirm in Zitadel logs or with a request to the instance lookup endpoint returning the expected instance.

  5. Issue and attach certificates

    Issue a certificate for the public hostname from your certificate authority or an automated issuer, and attach it to the proxy listener. For Traefik, Let's Encrypt certificates are a built-in option. For Nginx and Caddy, confirm the ACME or manual certificate workflow your team already uses. Keep the proxy-to-Zitadel leg encrypted if the network is not fully trusted, and make sure the certificate chain is complete. Done means an external TLS check from outside your network returns a valid certificate for the hostname with the expected chain and expiry, and the proxy logs show no certificate errors.

  6. Enable compression for console assets

    Turn on response compression at the proxy for the static assets served to the Console and Login pages, such as JavaScript, CSS and font files. Do not compress gRPC responses at the proxy unless you have tested that the chosen compression works with your clients, and exclude streaming routes from generic compression rules. Confirm that the proxy sends the compressed content type and encoding header for a sample asset. Done means a request for a Console asset returns a compressed response with the correct content type, and the proxy access log records the same response size reduction you measured in a test request.

  7. Verify with a browser login

    Open the Console or a test application through the public hostname in a clean browser session, sign in as a test user and complete the login flow, including any passkey or password prompt. Watch the browser network panel for the expected redirects and check that no mixed content or Host mismatch errors appear. Done means the login completes, the session is established, and the proxy access log shows the requests with the expected host and protocol. If the login fails with an instance not found message, return to the Host and Forwarded header step.

  8. Verify with a gRPC call and the access log

    Make a gRPC call through the public hostname, for example an API request your tooling uses to query the instance, and confirm it succeeds over HTTP/2. Then review the proxy access log to confirm the protocol field reads HTTP/2 for the gRPC route and that the Host value matches the public hostname. Done means the gRPC call returns the expected response and the access log shows HTTP/2 on the gRPC path. Record the proxy version, configuration file and the test results so the setup can be reproduced or audited later.

Questions teams ask before proxying Zitadel

Can our in-house team configure a reverse proxy in front of Zitadel alone?

Often yes, if your team already runs and certificate-manages a proxy and has someone who understands gRPC and HTTP/2. Zitadel's API and console traffic both pass through the proxy, so the work touches routing, TLS, the Host header and the upstream protocol together. Confirm three things before you start: who owns the edge today, whether your proxy can send HTTP/2 or h2c to an upstream, and whether a staging environment exists to test client behavior. If any of these is missing, a partner can fill the gap, and the written scope will show which parts your team keeps.

What drives the effort of a Zitadel proxy setup?

The main drivers are the number of endpoints and hostnames you expose, any existing WAF or CDN rules that already inspect or cache traffic, how certificates are issued and renewed, and how many gRPC clients call Zitadel directly. Each added hostname adds routing and Host header checks. Existing WAF or CDN rules may block or rewrite gRPC requests and need explicit exceptions. Automated certificates need a renewal path that the proxy and the Zitadel instance both trust. Direct gRPC clients need HTTP/2 end to end, which is the part most often missed in a first pass.

How long will a Zitadel proxy setup take?

The duration depends on the environment, so no fixed timeline should be taken from this page. A single hostname behind a proxy your team already operates is a different job from several hostnames, a CDN, a WAF and gRPC service clients. Ask for a written scope that lists each endpoint, each rule change, the test cases for browser login, API calls and gRPC clients, and the staging and production change windows. A dated plan in that scope is the reliable basis for comparing options, and it should name what is assumed about your environment.

What do we need to provide for the work?

Plan to supply DNS control for the public and internal hostnames, access to issue or renew certificates, a staging environment that mirrors the production proxy and network path, and named owners for the edge, the identity service and the applications that depend on it. You will also need the current proxy configuration, WAF or CDN rule exports and a list of gRPC or API clients. Missing owners cause the most delay, because routing and TLS choices affect several teams at once.

Does choosing Traefik or Nginx change the cost of the work?

It can change the effort, but the cost depends on what your team already runs. Traefik is MIT-licensed and distributed as a single Go binary and an official Docker image, and it generates routes from providers such as Docker, Kubernetes Ingress and Kubernetes Gateway API. Its Kubernetes Ingress NGINX provider supports many ingress-nginx annotations, which can reduce changes when moving off the retired NGINX Ingress Controller. Staying on an Nginx setup you already operate avoids a new skill set. Ask for a quote that prices the proxy change separately from the Zitadel configuration, so you can compare both paths on the same scope.

Which HTTP/2 and h2c settings are most often wrong?

The most common errors are an upstream configured for HTTP/1.1 when gRPC needs HTTP/2, a proxy that terminates TLS but forwards without the scheme and port Zitadel expects, and a Host header that does not match the configured external domain. Check that the upstream protocol matches what Zitadel serves, that gRPC responses and trailers pass through unchanged, and that compression is applied to console assets without breaking streaming responses. Test each client type separately, because a browser login can work while a service client still fails.

Does a proxy in front of Zitadel create security risk?

It can, if the proxy trusts forwarded headers from any source, exposes admin paths or logs sensitive headers. Limit which clients may set forwarding headers, restrict administrative and system endpoints to internal networks where your design allows, and confirm that access logs do not store tokens or credentials. Review WAF rules for false positives on OAuth and gRPC traffic, since blocking those requests breaks sign-in. Confirm these controls in your own environment and record the decisions in the written scope.

Security controls at the proxy edge

The reverse proxy is the first place untrusted traffic meets your Zitadel instance, so it decides which headers, paths and protocols reach the identity service. The cards below cover the proxy settings that set those trust boundaries, and each one should be checked against your own routing before go-live.

TLS versions and certificate renewal

Terminate TLS at the proxy with a modern protocol floor and disable legacy versions. Confirm that certificates renew automatically and that the renewal path is tested, because an expired certificate at the edge stops every login. Check that the certificate covers each external domain Zitadel serves, and that HTTP/2 and gRPC clients negotiate correctly after renewal. Review the cipher and protocol settings whenever your proxy version changes.

Self-hosting docs

Ignoring client-supplied Forwarded headers

Requests from the internet can carry their own X-Forwarded-For, X-Forwarded-Proto and Forwarded headers. The proxy should overwrite these with values it sets itself and drop any inbound copies from untrusted clients. Confirm which headers Zitadel reads to build external URLs and redirect targets, since spoofed values can change where login responses point. Limit trusted proxy addresses to the proxies you operate.

WAF rules that spare gRPC and login

Generic WAF signatures often flag gRPC framing, binary bodies, long cookies or JSON posted to login endpoints. Create exceptions scoped to the Zitadel API and login paths rather than disabling inspection globally. Test device authorization, passkey registration and the token endpoint through the WAF in staging. Log every blocked request on these paths so that a legitimate rule hit is visible to operations.

Access log retention and content

Keep proxy access logs long enough to investigate suspicious sign-ins and to support your incident response process, and set the retention period from your own policy rather than a default. Log the request path, status, timing and the forwarded client address, but avoid storing authorization headers, cookies or query strings that carry tokens. Restrict who can read these logs, and confirm that log storage is encrypted and rotated.

Restricting admin console paths

Zitadel's administration console and its management APIs should not be reachable from the public internet by default. Use the proxy to allow these paths only from administrator networks, a VPN or an identity-aware gateway, and return a clear denial for everything else. Keep the public login and OIDC discovery paths open, and test each path rule so that administrators can still reach the console and applications can still complete sign-in.

Zitadel API docs

How the proxy and Zitadel settings must agree

The public host, port and scheme that the proxy presents to clients must match the external domain Zitadel is configured to expect. Zitadel resolves each incoming request to an instance by reading the host it was addressed to, so a mismatch between what the proxy advertises and what Zitadel was set up with produces instance errors such as "Instance not found" even when the containers are healthy. Before you go live, write down the external domain, external port and whether TLS terminates at the proxy, then check that the proxy listener, its redirects and its upstream configuration all describe that same public address. Confirm the exact setting names in the Zitadel self-hosting documentation for your deployment method rather than copying them from another stack.

Zitadel uses the Host header to decide which instance and domain a request belongs to, so the proxy must forward that header to the upstream unchanged. Many default proxy configurations rewrite the host to the internal service name, which silently breaks login redirects, console access and token issuer checks because the generated URLs point at an address no browser can reach. Set the proxy to pass the original host through, and add forwarded headers that tell Zitadel the original scheme and client address only if your chosen proxy and Zitadel version document them. Test with a request that includes the public hostname and inspect the redirect locations in the response, since those reveal whether the host was preserved.

Changing the external domain, port or scheme after the first setup is not a simple proxy edit. Zitadel stores some of these values in its database during setup, so after a change you may need to rerun the setup phase against the same database instead of only restarting the proxy or the service. Plan this as a maintenance step with a database backup taken first, and list which hostnames will be served, including any extra domains you add later. Ask your team to confirm, for the Zitadel version you deploy, which values are read at runtime and which require setup to be rerun, because that answer determines whether a domain change is a configuration change or an outage window.

How DeployOpen scopes and delivers this work

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For Zitadel behind Nginx, Traefik or Caddy with HTTP/2, we start from your domain layout, proxy standard and gRPC clients, then build and verify the proxy path before handing it over.

How we scope

  • We confirm which proxy you run or plan to run, and whether a WAF or CDN sits in front of it.
  • We map which clients use gRPC or the Zitadel APIs, since those need an HTTP/2 or h2c upstream.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We configure Host and Forwarded headers so Zitadel sees the external domain and scheme it expects.
  • We set the TLS mode at the edge and the upstream connection, then test each route, including login and console assets.
  • We enable compression for console assets only after confirming it does not break the login flow.

How we hand over

  • You receive the proxy configuration, the header and TLS decisions with their reasons, and the test results.
  • We document how to add a route, rotate certificates and check the upstream protocol after a change.
  • Your team runs the final verification checklist with us so the handover is confirmed in your environment.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Proxy and Zitadel version changes are retested before they reach production, using the agreed test set.
  • Support scope and response arrangements are written into the retainer before work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.