fix: trust forwarded headers for HTTPS file URLs

Add FORWARDED_ALLOW_IPS=* so uvicorn/Gradio trusts X-Forwarded-Proto
from nginx in Docker (bridge network 172.x.x.x). Without this, Gradio
generates http:// file URLs behind HTTPS proxies, causing mixed-content
errors that block audio playback.
This commit is contained in:
Daniel Cox
2026-08-12 09:00:55 +09:30
parent da5b2da097
commit 74b98d2c1e
2 changed files with 7 additions and 0 deletions

View File

@@ -32,6 +32,11 @@ services:
environment:
- GRADIO_SERVER_PORT=7860
- GRADIO_ROOT_PATH=/webui # Matches nginx location block
# Tell uvicorn to trust X-Forwarded-Proto from any IP (nginx in Docker
# connects from 172.x.x.x, not 127.0.0.1). Without this, Gradio
# generates http:// file URLs even when accessed over HTTPS, causing
# mixed-content errors that block audio playback in the browser.
- FORWARDED_ALLOW_IPS=*
restart: unless-stopped
nginx: