mirror of
https://github.com/niels-emmer/myace.git
synced 2026-09-14 07:36:39 +02:00
[PR #67] [MERGED] fix: OAuth redirect_uri always generated as http:// behind reverse proxy #67
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
github-mirrors/myace#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/niels-emmer/myace/pull/67
Author: @niels-emmer
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/12/2026
Merged by: @niels-emmer
Base:
main← Head:fix/oauth-redirect-uri-scheme📝 Commits (1)
48d1130fix: forward real X-Forwarded-Proto through frontend nginx instead of overwriting it📊 Changes
3 files changed (+59 additions, -1 deletions)
View changed files
📝
AGENTS.md(+9 -0)📝
docs/debugging.md(+38 -0)📝
frontend/nginx.conf(+12 -1)📄 Description
Summary
docker-compose.prod.yml's reverse-proxy setup was rejected by the provider with a redirect-URI-mismatch error, even though the registered callback URL was exactly correct.frontend/nginx.conf's/api/location unconditionally setX-Forwarded-Proto: $scheme, overwriting the correcthttpsvalue the external reverse proxy (nginx-proxy-manager) had already set, with its own$scheme— alwayshttp, since that container never terminates TLS. The backend trustsX-Forwarded-Prototo buildredirect_uriviarequest.url_for(), so it always generatedhttp://...regardless of the real scheme.$schemeonly when nothing set it (the no-reverse-proxy, basedocker-compose.ymlcase).docs/debugging.mdentry and extendedAGENTS.mdrule 27 (production hardening/proxy-header trust chain) — this is exactly the kind of two-hop proxy gotcha that rule already existed to describe, it was just missing this half of the chain.Test plan
curl https://myace.macjuu.com/api/v1/auth/login/githubshowedredirect_uri=http%3A%2F%2Fmyace.macjuu.com%2F...in theLocationheader before this fix.computed=httpswhen sentX-Forwarded-Proto: https, andcomputed=http(unchanged, correct fallback) when not — proving themapforwards the real value instead of always overwriting it.nginx -t, clean startup logs).docker-compose.dev.yml— dev's uvicorn command intentionally omits--proxy-headers(dev doesn't need scheme-awareness), so this needed the nginx-layer test above instead.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.