# Add these location blocks inside the main server block in /etc/nginx/sites-enabled/duchess
# (before the location /api/ block)

# P2P Video static files
location /p2p/ {
    alias /home/josh/p2p-video/;
    try_files $uri $uri/ =404;
}

# WebSocket signaling server (secure via nginx SSL termination)
location /p2p-signal {
    proxy_pass http://127.0.0.1:8080;
    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_read_timeout 86400;
}
