Spaces:
Running
Running
| worker_processes 1; | |
| error_log /dev/stderr warn; | |
| pid /tmp/nginx.pid; | |
| events { | |
| worker_connections 512; | |
| } | |
| http { | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| access_log /dev/stdout; | |
| client_max_body_size 100M; | |
| server { | |
| listen 7860; | |
| # Next.js API routes (SSE streaming) → Next.js standalone (port 3030) | |
| location ~ ^/api/transcribe-stream(/|$) { | |
| proxy_pass http://127.0.0.1:3030; | |
| proxy_read_timeout 660s; | |
| proxy_send_timeout 660s; | |
| proxy_connect_timeout 10s; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| # SSE: disable buffering so tokens flush immediately | |
| proxy_buffering off; | |
| proxy_cache off; | |
| proxy_set_header X-Accel-Buffering no; | |
| } | |
| # API + health check → Node proxy server (port 3000) | |
| location ~ ^/(api|health)(/|$) { | |
| proxy_pass http://127.0.0.1:3000; | |
| proxy_read_timeout 660s; | |
| proxy_send_timeout 660s; | |
| proxy_connect_timeout 10s; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } | |
| # All other requests → Next.js standalone (port 3030) | |
| location / { | |
| proxy_pass http://127.0.0.1:3030; | |
| 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 Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| } | |
| } | |
| } | |