fix(prod): trust proxy headers so OAuth redirect_uri uses https
Behind Coolify's reverse proxy the backend saw requests as http and built an http:// redirect_uri, causing Google 'redirect_uri_mismatch'. Run uvicorn with --proxy-headers --forwarded-allow-ips=* so X-Forwarded-Proto (https) is honored.
This commit is contained in:
parent
a122c90c89
commit
5118fd6989
1 changed files with 4 additions and 2 deletions
|
|
@ -76,5 +76,7 @@ RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"
|
||||||
# Expose FastAPI port
|
# Expose FastAPI port
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Run FastAPI app
|
# Run FastAPI app. --proxy-headers + --forwarded-allow-ips trust the reverse
|
||||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
# proxy's X-Forwarded-Proto so generated URLs (e.g. the OAuth redirect_uri) use
|
||||||
|
# https in production instead of the internal http scheme.
|
||||||
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips", "*"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue