Can't apply a worker to a subdomain

I am trying to generate a robots.txt file to one of my subdomains.
The worker script simply returns a string, nothing else

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})


async function handleRequest(request) {
  return new Response('User-agent: *\nDisallow: /');
}

However, when I try to apply the route matching rule:

https://mysubdomain.mydomain.com/robots.txt

The worker is not triggered.

If I change the route to match my domain, the worker is triggered.

https://mydomain.com/robots.txt

How can this be solved?

is the rule?

https://mysubdomain.mydomain.com/robots.txt

Yes that is the rule

Is the subdomain :orange: in the DNS settings?

Yeah it is, but official CF support told me that CF proxy must be active in order to trigger the Workers. So I guess mystery is solved.

Well, if it’s :orange: proxy is active.