server { listen 80; root /usr/share/nginx/html; index index.html; location /api/ws/ { proxy_pass http://backend:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_read_timeout 3600; } location /api/ { proxy_pass http://backend:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 3600; } location /static/ { proxy_pass http://backend:8000/static/; proxy_set_header Host $host; } # Native app APK for sideloading (bundled by scripts/build-apk.mjs release). # Real 404 when absent - never fall through to index.html. location /downloads/ { types { application/vnd.android.package-archive apk; } add_header Cache-Control "no-cache"; try_files $uri =404; } location / { try_files $uri $uri/ /index.html; } }