Fix jwt-token

This commit is contained in:
2025-08-17 08:27:55 +02:00
parent bbccefe557
commit 8d53b2f74e
2 changed files with 4 additions and 23 deletions

View File

@@ -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');

View File

@@ -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;