79280555

Date: 2024-12-14 11:38:47
Score: 0.5
Natty:
Report link

I found a solution by referring to this GitHub issue: https://github.com/encode/uvicorn/issues/369.

To be more specific, I changed the way I was starting my FastAPI web app. Previously, I used:

fastapi run --workers 4 app/main.py

I switched to using directly Uvicorn with the following command:

uvicorn your_app:app --host 0.0.0.0 --port 8000 --proxy-headers --forwarded-allow-ips "*"

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Aurbcd