# External Nginx configuration. Put the map block in nginx.conf's http {} # section only once. Replace 10.0.0.20 with the application server's private IP. map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; server_name share.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name share.example.com; # Replace with your existing certificate paths. ssl_certificate /etc/letsencrypt/live/share.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/share.example.com/privkey.pem; location / { # This one upstream handles the frontend, API, and LiveKit signalling. proxy_pass http://10.0.0.20:8081; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_read_timeout 3600s; } }