Skip to content

Conversation

@sdsdsdff
Copy link

背景:部署在 Cloudflare Workers 时,Worker 默认会在访问者就近的 colo 执行。
实测在部分 APAC colo(例如 SIN / 部分 TW 线路)下,Worker 出站请求 grok 上游会触发 Cloudflare Challenge(返回“Just a moment...”),导致 upstream 403,最终接口返回 500(upstream_error)。
而当请求落到 LAX 等美区 colo 时,同样请求可以稳定 200。

改动:在 wrangler.toml 增加 placement hint:

[placement]
region = "aws:us-west-2"

让 Worker 执行/出站更倾向美区,从而规避上述 upstream block(已在实际环境验证生效)。

Copilot AI review requested due to automatic review settings January 30, 2026 11:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses production issues where Cloudflare Workers executing from certain APAC colos (e.g., SIN, some Taiwan routes) encounter upstream blocking when requesting the Grok API, resulting in 403/500 errors. The solution pins Worker execution to the US West region where requests succeed reliably.

Changes:

  • Added placement configuration to wrangler.toml to pin Worker execution to the aws:us-west-2 region, avoiding upstream blocks from certain APAC colos

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant