The Simplest Way to Make Caddy and Zscaler Work Like They Should
Running caddy and zscaler together lets teams route private traffic to internal web apps. Zscaler checks user identities at the edge, while Caddy serves local web pages. This setup keeps internal services off the public internet. Engineers can reach private apps from anywhere after they log in. How caddy and zscaler handle logins and traffic The workflow starts when a user requests a private web app. The device sends this traffic to the Zscaler cloud edge first. Zscaler checks the user ident
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Running caddy and zscaler together lets teams route private traffic to internal web apps. Zscaler checks user identities at the edge, while Caddy serves local web pages.
This setup keeps internal services off the public internet. Engineers can reach private apps from anywhere after they log in.
How caddy and zscaler handle logins and traffic
The workflow starts when a user requests a private web app. The device sends this traffic to the Zscaler cloud edge first. Zscaler checks the user identity and device posture against team rules. If the check passes, Zscaler forwards the request to a local connector. That connector sits inside the private network near your servers.
The local connector then sends the web request to Caddy. Caddy acts as the web server for your internal apps. It terminates TLS and routes the request to the right backend service. Caddy also handles automatic certificate renewals for your local domains. It can read headers passed from the connector to check user details.
Both tools must agree on how to handle certificates and headers. When you set up both sides well, traffic flows with low delay. Users get a secure path from their browser to the app.
Common failure modes and how to scope network paths
Many teams run into trouble with TLS certificate checks between the two tools. Caddy tries to fetch public certificates by default. Still, Zscaler connectors block inbound public traffic from reaching the server. To fix this, teams must use DNS challenges for certificate renewal. This lets Caddy get valid certificates without opening public firewall ports.
Another common risk comes from broad network paths in the connector setup. Teams often allow the connector to reach an entire private subnet. If a user logs in, they might reach extra ports on the server. You should scope connector rules to the exact IP and port Caddy uses. Block all other ports on the internal network.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Shared service accounts and unlogged queries also create blind spots for security teams. If the connector forwards traffic without identity headers, Caddy logs only the connector IP. Every request looks like it came from the same internal machine. Teams should pass user headers and write them to the Caddy log. Also, avoid using static shared keys for backend app logins.
Best practices for ongoing maintenance
Keep your internal domain names consistent across both tools. When a DNS record changes, update the routing rules right away. Test certificate renewals in a staging setup before moving to production.
Review your access logs every week to spot strange traffic patterns. Make sure both tools send their logs to a central team store. This helps you trace a single request from the user to the app. Good logs make it fast to fix broken routes or blocked requests.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Why does Caddy fail to renew certificates behind Zscaler?
Zscaler blocks inbound public web requests from reaching your private server. Caddy cannot complete standard HTTP checks, so you must set up DNS checks instead.
How do I see the real user IP in Caddy logs?
Set up the local connector to pass forwarding headers to the upstream server. Then tell Caddy to trust the connector IP and log those headers.
Should Zscaler or Caddy handle user logins for internal apps?
Let Zscaler check the primary user login at the network edge first. Caddy can then check specific headers or pass them to the app for role checks.
Related guides
In this post