diff --git a/client/src/contexts/SocketContext.jsx b/client/src/contexts/SocketContext.jsx index 9e78bbb..81af457 100644 --- a/client/src/contexts/SocketContext.jsx +++ b/client/src/contexts/SocketContext.jsx @@ -16,9 +16,10 @@ export const SocketProvider = ({ children }) => { if (isAuthenticated) { // Initialize socket connection const newSocket = io(process.env.NODE_ENV === 'production' - ? window.location.origin + '/drones' - : 'http://localhost:3001' - ); + ? window.location.origin + : 'http://localhost:3001', { + path: process.env.NODE_ENV === 'production' ? '/drones/socket.io/' : '/socket.io/' + }); newSocket.on('connect', () => { console.log('Connected to server'); diff --git a/nginx/selfservice-with-drones.cqers.com b/nginx/selfservice-with-drones.cqers.com index 3e68249..405a1a7 100644 --- a/nginx/selfservice-with-drones.cqers.com +++ b/nginx/selfservice-with-drones.cqers.com @@ -147,26 +147,6 @@ server { proxy_read_timeout 300s; } - # Socket.IO endpoint without /drones/ prefix (for compatibility) - location /socket.io/ { - proxy_pass http://drone_backend/socket.io/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # WebSocket specific headers - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_cache_bypass $http_upgrade; - - # Longer timeouts for persistent connections - proxy_connect_timeout 60s; - proxy_send_timeout 300s; - proxy_read_timeout 300s; - } - # Original selfservice application - proxy directly to Docker container location / { proxy_pass http://selfservice_docker;