Same Origin - Error 404 in debug

Hello,

I configured it according to the documentation:

A new way to set up a custom domain in server GTM - Stape

However, I’m not getting the expected result in /healthy, it’s going to an internal page of the website with a 404 error.

I’ll send you screenshots of the established configurations:

  1. Worker

  2. Worker Route
    magazinestorm. com/metrics*

  3. Configuration Rules
    Url Path equals /metrics
    SSL Full

Request Header Transform Rules
URL Path contains /metrics
Set static X-From-Cdn = cf-stape

  1. Server Container URLs
    https:// magazinestorm. com/metrics

  2. Debug return error 404

  3. /healthy return error 404 too.

(I inserted spaces in the links because new users cannot submit more than one link, and I also couldn’t send more than one image.)

I am a beginner and would like help from my friends, I apologize in advance for any mistakes.

This means that the request doesn’t reach your worker and is handled before that by some rule or other worker that redirects to 404 page. You need to check your other settings on CF and make an exception in them for your same origin path.

In the configuration rules I only have these two rules:

As for the worker, the same thing, I only have this one in CF:

Do I need to do any additional Shopify DNS configuration for CF? Could this be the issue?

I didn’t realise you had Shopify.

On Shopify same origin is not possible. To make it work you need to proxy all site traffic through CF, and Shopify doesn’t have that option. So your request for /metrics just doesn’t get to Cloudflare, it’s processed by Shopify and sent to a 404 page as no such page exists.

Sure. And would there be any other way? So should I use Own CDN instead of Stape CDN?

Cookie Keeper is only option for Shopify to bypass ITP restriction on cookie lifetime: Prolong first-party cookie lifetime set by a third-party IP - Stape