Repository navigation
fix(proxy): Forward the query string in the agent relay - #650
Merged
Merged
Conversation
The proxy location that relays `/<server>:<port>/agent/...` builds `proxy_pass` from regex captures. With variables, nginx sends only the URI built from them, so the query string was dropped for every server that Press reaches through a proxy (servers with no public IP). Two agent routes need it: site info `database_only`, so big sites still did the full file walk, and `server/backup-jobs`, which failed with 400 "site is required". `$is_args$args` adds it back, and a request with no query string is forwarded as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
[Medium impact] The PR appears safe to merge. Reviews (1) · Last reviewed commit: "fix(proxy): Forward the query string in ..." · Reviewed by Greptile |
balamurali27
added a commit
that referenced
this pull request
Oct 25, 2026
fix(proxy): Forward the query string in the agent relay (backport #650)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The relay location on proxies (added in #412) builds
proxy_passfrom regex captures. With variables inproxy_pass, nginx sends only the URI built from them, so the query string is dropped. Press sends agent calls through this relay for every server with no public IP (about 1,000 app servers and 1,000 DB servers on prod).Two agent routes read the query string, and both break through the proxy:
benches/<bench>/sites/<site>/info?database_only=1(perf(site): Avoid file-tree walk when only database usage is needed #548): the flag never arrives, so the agent still walks all site files. On a big site this takes more than the 30 s Press timeout, and each timeout trips the agent request breaker for the whole server.server/backup-jobs?site=...&start=...&end=...: fails with 400 "site is required" for these servers.$is_args$argsadds the query string back. A request with no query string is forwarded as before, with no stray?.I checked the same location shape in an
nginx:1.27-alpinecontainer. The old form forwards/agent/.../info?database_only=1as/agent/.../info. The new form keeps?database_only=1and the fullbackup-jobsquery, and forwards/agent/pingunchanged.nginx -tpasses.Rollout: the new config takes effect on a proxy only after its agent nginx config is written again and nginx is reloaded. A reload with a bad config fails and keeps the old config running.
🤖 Generated with Claude Code