/Documentation

How to use same origin through Apache HTTP Server

Updated May 10, 2026

Step 1: Enable the required modules​

sudo a2enmod proxy sudo a2enmod proxy_httpsudo a2enmod ssl

Step 2: Update your config​

ServerName website.com ProxyRequests off ProxyPreserveHost off SSLProxyEngine on RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}e" RequestHeader set X-From-Cdn "cf‑stape" RequestHeader set CF-Connecting-Ip "%{REMOTE_ADDR}e" RequestHeader set Host "sgtm.example.com" ProxyPass "/metrics" "https://sgtm.example.com" ProxyPassReverse "/metrics" "https://sgtm.example.com"

Step 3: Adjust your deployed script

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?