workers: 固定 placement 到美区,规避部分 colo 出站被拦导致的 403/500 #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
背景:部署在 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(已在实际环境验证生效)。