server { listen 9178 ssl; root /var/www/voice; index index.html; ssl_certificate /etc/voice/certs/cert.pem; ssl_certificate_key /etc/voice/certs/key.pem; client_max_body_size 16k; location /api/attachments { client_max_body_size 20m; proxy_pass http://127.0.0.1:8092; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 120s; proxy_request_buffering off; } location ~ ^/api/(artifacts|memory)(/|$) { client_max_body_size 1m; proxy_pass http://127.0.0.1:8092; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 120s; } location /api/tasks { client_max_body_size 64k; proxy_pass http://127.0.0.1:8092; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 120s; } # Public certificate-only onboarding profile lives in the persistent cert # mount. Never expose that directory: it also contains the private key. location = /hope-server.mobileconfig { alias /etc/voice/certs/hope-server.mobileconfig; default_type application/x-apple-aspen-config; add_header Cache-Control "no-store"; } location = /voices { proxy_pass http://127.0.0.1:8091/voices; proxy_set_header Host $host; proxy_read_timeout 30s; } location = /token { proxy_pass http://127.0.0.1:8091/token; proxy_set_header Host $host; } # The private control/provisioning endpoints are never proxied. location /api/ { proxy_pass http://127.0.0.1:8092/api/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 700s; proxy_buffering off; proxy_set_header X-Accel-Buffering no; } location /internal/ { return 404; } location = /livekit { return 301 /livekit/; } location /livekit/ { proxy_pass http://127.0.0.1:7880/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_read_timeout 3600s; proxy_send_timeout 3600s; } location / { try_files $uri $uri/ =404; } }