Fix jwt-token
This commit is contained in:
@@ -16,9 +16,10 @@ export const SocketProvider = ({ children }) => {
|
|||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
// Initialize socket connection
|
// Initialize socket connection
|
||||||
const newSocket = io(process.env.NODE_ENV === 'production'
|
const newSocket = io(process.env.NODE_ENV === 'production'
|
||||||
? window.location.origin + '/drones'
|
? window.location.origin
|
||||||
: 'http://localhost:3001'
|
: 'http://localhost:3001', {
|
||||||
);
|
path: process.env.NODE_ENV === 'production' ? '/drones/socket.io/' : '/socket.io/'
|
||||||
|
});
|
||||||
|
|
||||||
newSocket.on('connect', () => {
|
newSocket.on('connect', () => {
|
||||||
console.log('Connected to server');
|
console.log('Connected to server');
|
||||||
|
|||||||
@@ -147,26 +147,6 @@ server {
|
|||||||
proxy_read_timeout 300s;
|
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
|
# Original selfservice application - proxy directly to Docker container
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://selfservice_docker;
|
proxy_pass http://selfservice_docker;
|
||||||
|
|||||||
Reference in New Issue
Block a user