/Documentation

How to use same origin through Nginx

Updated Oct 1, 2026

Setup guide

location = /metrics { return 302 /metrics/; } location ~ ^/metrics(.*) { resolver 8.8.8.8 valid=3600s; proxy_pass https://gtm.mysimple.name$1$is_args$args; proxy_set_header Host gtm.mysimple.name; proxy_set_header X-From-Cdn "cf-stape"; proxy_set_header CF-Connecting-Ip $remote_addr; #If you do not use Cloudflare for your domain #proxy_set_header CF-Connecting-Ip $http_cf_connecting_ip; #If you use Cloudflare for your domain }

Custom Loader

Update Custom Loader

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?