Spaces:
Running
Running
| worker_processes 1; | |
| pid /tmp/nginx.pid; | |
| error_log /dev/stdout info; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| client_body_temp_path /tmp/client_temp; | |
| proxy_temp_path /tmp/proxy_temp_path; | |
| fastcgi_temp_path /tmp/fastcgi_temp; | |
| uwsgi_temp_path /tmp/uwsgi_temp; | |
| scgi_temp_path /tmp/scgi_temp; | |
| access_log /dev/stdout; | |
| server { | |
| listen ${PORT}; | |
| # Explicitly route OpenEnv API endpoints to FastAPI (port 8000) | |
| location ~ ^/(reset|step|state|openapi.json|docs|web|assets|health) { | |
| proxy_pass http://127.0.0.1:8000; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| } | |
| # Catch-all: Route everything else to Streamlit (port 8501) | |
| location / { | |
| proxy_pass http://127.0.0.1:8501; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| 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; | |
| proxy_read_timeout 86400; | |
| } | |
| } | |
| } | |