Skip to main content
You can proxy the Trfyx tracker and event endpoint through Nginx so requests stay on your domain.
1

Add Nginx configuration

Add two locations to your server block: one for the tracker and one for event collection.
nginx.conf
If /api/events is already used by your application, choose another public path and configure data-api-url accordingly.
2

Update the tracker

Update the tracker snippet to use the proxied path:
index.html
3

Test and reload

Validate the configuration and reload Nginx:
Terminal
4

Verify installation

Open your production site and verify requests in your browser Network panel. Confirm both script.js and /api/events use your domain, then check that activity shows in Trfyx.
Correct X-Real-IP and X-Forwarded-For handling is important for visitor location accuracy. If your site is behind another CDN or load balancer, configure the complete trusted proxy chain.

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