/Documentation

How to use same origin through Caddy

Updated Aug 12, 2026

Update your Caddyfile​

@sgtm path /metrics handle @sgtm {         reverse_proxy https://sgtm.example.com {             header_up X-Forwarded-For {remote_host}             header_up X-From-Cdn "cf-stape"             header_up CF-Connecting-Ip {remote_host}             header_up Host sgtm.example.com         }     }

Testing your Same Origin setup

Test GA4 tag
Adding the same-origin path to container settings
Preview opened at the new path
Incoming page_view request from your real domain

Was this article helpful?

Comments

Can’t find what you are looking for?