Commit 3ed4124
fix(deploy): enable uvicorn --proxy-headers so OIDC works behind reverse proxies
Without ``--proxy-headers``, uvicorn ignores the X-Forwarded-Proto
header set by an upstream reverse proxy (AWS ALB, Nginx, Cloudflare,
…) and ``request.url.scheme`` inside the container reads "http" even
when the user hit "https". Every scheme-aware code path then silently
builds wrong URLs — most visibly the OIDC redirect_uri, which fails
to match what's registered with the IdP. Entra returns AADSTS50011;
Google / Okta / Auth0 surface equivalents. Login is dead on arrival.
The fix is a one-line addition to the production CMD in Dockerfile.
``--forwarded-allow-ips=*`` is safe behind ECS+ALB (and any equivalent
shape) because the network controls ensure only the proxy can reach
:8080 and the proxy strips client-supplied X-Forwarded-* before
forwarding.
Caught while planning the UIC production rollout of PR2 (#129) before
any wrong URI ever reached Entra.
Also adds a "Behind a reverse proxy" section to the SSO how-to so
other OSS operators don't rediscover this. The fix is now baked into
the shipped Dockerfile, but operators who replace the CMD need to
keep the flag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cfc6283 commit 3ed4124
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
129 | 143 | | |
130 | 144 | | |
131 | 145 | | |
| |||
0 commit comments