server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Proxy API + WebSocket requests to the FastAPI container location /session/ { proxy_pass http://linnet-api:8522; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # WebSocket upgrade for the audio WS endpoint proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # SSE: disable buffering so events reach the client immediately proxy_buffering off; proxy_read_timeout 3600s; } location /health { proxy_pass http://linnet-api:8522; proxy_set_header Host $host; } location = /index.html { add_header Cache-Control "no-cache, no-store, must-revalidate"; try_files $uri /index.html; } location / { try_files $uri $uri/ /index.html; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ { expires 1y; add_header Cache-Control "public, immutable"; } }