cloudflare worker not triggered on a route - Stack Overflow

I have a cloudflare worker but it's not triggered on a route I configured.routes = [{ pattern =

I have a cloudflare worker but it's not triggered on a route I configured.

routes = [
{ pattern = "myapp/resources-v2/*", zone_id = "abc123"}
]

I can see the worker in the domain's settings in cloudflare under the "workers routes" tab. This tells me that the zone_id at least is right.

As for the pattern, I can see the browser calling https://myapp/resources-v2/very long/list/of/resources/?query-params=im-stuck-and-need-help in the developers' console.

And finally, when I go directly to the worker's address at*.workers.dev I can see logs appearing in cloudflare. So the worker is deployed.

I don't know what I can verify besides these 3 things I mentioned above.

Can someone please give me a hint?

Thanks kindly

I have a cloudflare worker but it's not triggered on a route I configured.

routes = [
{ pattern = "myapp/resources-v2/*", zone_id = "abc123"}
]

I can see the worker in the domain's settings in cloudflare under the "workers routes" tab. This tells me that the zone_id at least is right.

As for the pattern, I can see the browser calling https://myapp/resources-v2/very long/list/of/resources/?query-params=im-stuck-and-need-help in the developers' console.

And finally, when I go directly to the worker's address at*.workers.dev I can see logs appearing in cloudflare. So the worker is deployed.

I don't know what I can verify besides these 3 things I mentioned above.

Can someone please give me a hint?

Thanks kindly

Share Improve this question asked Nov 18, 2024 at 16:40 A-friendly-gopherA-friendly-gopher 1
Add a comment  | 

1 Answer 1

Reset to default 0

You can try the following:

  • make sure that your domain myapp dns record is configured as proxied (with the orange cloud icon enabled in the DNS settings). If it is not proxied, it means the request will not go through Cloudflare and will not trigger the worker;
  • you can use Cloudflare Trace to check how the request goes through Cloudflare;
  • try using a more general pattern, like *myapp/*;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745607025a4635729.html

相关推荐

  • cloudflare worker not triggered on a route - Stack Overflow

    I have a cloudflare worker but it's not triggered on a route I configured.routes = [{ pattern =

    3小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信