Skip to main content
Caddy can reverse-proxy the Trfyx script and event endpoint through your website.
1

Add Caddy configuration

Add handle blocks for the Trfyx paths to your Caddyfile:
Caddyfile
If /api/events is already used by your application, choose another path and set data-api-url to that path.
2

Update the tracker

Replace the default Trfyx script with the proxied path:
index.html
3

Verify installation

Reload Caddy, open your production site, and verify both requests in the browser Network panel. Confirm the visit appears in Trfyx.
Make sure the visitor IP is preserved through any CDN or load balancer in front of Caddy.

Next steps

Proxy setup

Read the full proxy setup guide

Managed Proxy

Let Trfyx manage the proxy for you

Goals

Start tracking goals with Trfyx

Troubleshooting

Fix common proxy issues
Last modified on October 12, 2026