The Simplest Way to Make Caddy and Phabricator Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using caddy and phabricator together gives your team a fast, secure code review site. Caddy handles web certificates and routes traffic to the Phabricator app. Engineering teams rely on Phabricator to review code, track bugs, and host Git repos. Running it behind Caddy removes the pain of manual TLS certificate renewals. You get clean URLs, safe web traffic, and a stable place for daily code work. How traffic and logins flow between caddy and phabricator When a developer opens a code review

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.

Using caddy and phabricator together gives your team a fast, secure code review site. Caddy handles web certificates and routes traffic to the Phabricator app.

Engineering teams rely on Phabricator to review code, track bugs, and host Git repos. Running it behind Caddy removes the pain of manual TLS certificate renewals. You get clean URLs, safe web traffic, and a stable place for daily code work.

How traffic and logins flow between caddy and phabricator

When a developer opens a code review link, the request hits Caddy first. Caddy checks its TLS certificates and secures the connection right away. If a certificate is missing or old, Caddy gets a new one on its own.

After the secure link is ready, Caddy sends the request to the PHP backend. Phabricator runs on PHP and needs a fast link to process web pages. Caddy talks to the PHP service over a local port or a Unix socket.

Caddy also passes client headers so Phabricator knows the real user IP address. It sets the protocol header to HTTPS so Phabricator builds secure page links. Without this header, Phabricator might try to send users back to plain HTTP links.

Once the request reaches the app, Phabricator checks the user session cookie. If the user is not logged in, Phabricator redirects them to the login provider. After login, the user can read code, write comments, and push changes based on roles.

Common setup failures and how to fix permissions

Many teams run into trouble when they use broad permissions or shared keys. One common issue is running the web server and the PHP process as root. If an attacker finds a bug, they gain full control over the host machine.

You should run Caddy and the PHP service under separate, low-privilege system accounts. Give the Caddy user read access only to static files and public assets. Keep the Phabricator code and secret keys locked down to its own system account.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another failure happens when teams share one admin API token across many build scripts. When a build script breaks or leaks a key, you cannot tell who acted. Instead, create a dedicated bot user in Phabricator for each script or tool.

Unlogged database queries and missing web logs also hurt your team during an outage. Turn on structured logs in Caddy and make sure you do not log user cookies. Check that your firewall blocks outside traffic from hitting the PHP port directly.

How to handle Git traffic and large file uploads

Phabricator does more than serve web pages; it also hosts your Git repos. Developers can push and pull code over HTTP or SSH during their daily work. When they use HTTP for Git, all that repo traffic flows through Caddy first.

Large Git pushes or big file attachments on tasks can fail with default limits. If Caddy drops a large request early, the developer sees a confusing error message. You must check that body size limits match across Caddy, PHP, and Phabricator.

Live notifications also need special care when you set up your web server. Phabricator uses a notification server to push live alerts to open browser tabs. Caddy must route that WebSocket path to the notification port without dropping idle links.

By splitting web traffic, Git calls, and live alerts into clear rules, things stay fast. Your team gets quick diffs, reliable Git pushes, and clear audit logs for every action.

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 Phabricator show a redirect loop behind Caddy?

This loop happens when Phabricator thinks the request came in over plain HTTP. Make sure Caddy passes the forwarded protocol header and set the base URI to HTTPS.

How should we secure the MySQL database used by Phabricator?

Place the database on a private network that only the Phabricator host can reach. Use separate database credentials for normal app reads and schema update tasks.

Can Caddy serve static files for Phabricator directly?

Yes, Caddy can serve static CSS and image files from the Phabricator webroot folder. Still, Phabricator sends most user uploads through PHP to check file view rules first.

The query runs. The emails stay hidden.