HTTPS Reverse Proxy for Uvicorn with Apache
HTTPS reverse proxy for Uvicorn with Apache
Bind Uvicorn to 127.0.0.1 only and terminate TLS in Apache. Do not use --reload, expose the backend port, or disable upstream certificate verification.
ProxyRequests Off
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/Enable needed proxy/ssl/headers modules, run apachectl configtest, then gracefully reload.