Spaces:
Build error
Build error
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| include /etc/nginx/modules-enabled/*.conf; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; | |
| keepalive_timeout 65; | |
| types_hash_max_size 2048; | |
| server { | |
| listen 7860 default_server; | |
| server_name _; | |
| # Increase body size for audio uploads if needed | |
| client_max_body_size 50M; | |
| # Route /api requests to FastAPI | |
| # The trailing slash in proxy_pass automatically strips /api/ | |
| location /api/ { | |
| proxy_pass http://127.0.0.1:8000/; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| # Debug header | |
| add_header X-Backend "FastAPI" always; | |
| } | |
| # Route everything else to Streamlit | |
| location / { | |
| proxy_pass http://127.0.0.1:8501/; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| # WebSocket support for Streamlit | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_read_timeout 86400; | |
| # Debug header | |
| add_header X-Backend "Streamlit" always; | |
| } | |
| } | |
| } | |