fix(ee): follow HTTP→HTTPS redirects in forward_to_control_plane#8360
Merged
fix(ee): follow HTTP→HTTPS redirects in forward_to_control_plane#8360
Conversation
Contributor
Greptile OverviewGreptile SummaryFixes proxy requests failing when control plane sits behind nginx with HTTP→HTTPS redirect.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant SH as Self-Hosted Instance
participant DP as Cloud Data Plane<br/>(proxy.py)
participant NG as Nginx<br/>(HTTP→HTTPS)
participant CP as Control Plane
SH->>DP: POST /proxy/create-checkout-session<br/>(with license Bearer token)
DP->>DP: Verify license signature
DP->>NG: POST http://control.example.com/create-checkout-session<br/>(with JWT token)
Note over NG: Returns 308 Permanent Redirect<br/>Location: https://control.example.com/...
NG-->>DP: 308 Redirect
Note over DP: httpx.AsyncClient with<br/>follow_redirects=True
DP->>CP: POST https://control.example.com/create-checkout-session<br/>(follows redirect automatically)
CP-->>DP: 200 OK {url: "stripe.com/..."}
DP-->>SH: 200 OK {url: "stripe.com/..."}
|
httpx does not follow redirects by default (unlike requests). The control plane's nginx returns a 308 HTTP→HTTPS redirect, which caused proxy requests to fail with "Control plane request failed" instead of following the redirect transparently.
1718858 to
0562626
Compare
justin-tahara
approved these changes
Feb 11, 2026
Contributor
justin-tahara
left a comment
There was a problem hiding this comment.
Glad it was something simple
Same issue as proxy.py — httpx does not follow redirects by default (unlike requests), causing 308 failures when the control plane nginx redirects HTTP→HTTPS.
nmgarza5
added a commit
that referenced
this pull request
Feb 19, 2026
2 tasks
nmgarza5
added a commit
that referenced
this pull request
Feb 19, 2026
Danelegend
pushed a commit
that referenced
this pull request
Feb 20, 2026
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.
Description
forward_to_control_planeinproxy.pyand_make_billing_requestinservice.pyboth usehttpx.AsyncClientwhich does not follow redirects by default (unlikerequests). The control plane's nginx returns a 308 HTTP→HTTPS permanent redirect, causing these requests to fail with "Control plane request failed". Addingfollow_redirects=Trueto both fixes this.Why this only affects production
Locally, the control plane runs directly on
http://localhostwith no nginx in front, so there is no HTTP→HTTPS redirect. In production, nginx sits in front of the control plane and forceshttp://→https://, producing the 308 thathttpxrefuses to follow. Every other code path that talks to the control plane uses therequestslibrary, which follows redirects by default —forward_to_control_planeand_make_billing_requestare the only ones usinghttpx.How Has This Been Tested?
Unit tests added for both
proxy.pyandservice.pyverifyingAsyncClientis constructed withfollow_redirects=True. Needs deployment to cloud DP to verify end-to-end.Additional Options