server { listen ${PORT}; server_name _; root /opt/excalidraw/build; index index.html; # React single-page app location / { try_files $uri /index.html; } # WebSocket collaboration server location /room/ { proxy_pass http://127.0.0.1:${ROOM_PORT}/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } # HTTP storage backend location /api/ { proxy_pass http://127.0.0.1:${STORAGE_PORT}/; proxy_set_header Host $host; } }