Next.js Discord

Discord Forum

Question for Socket.IO: Server sents weird "Invalid frame header" message in websocket

Unanswered
gin posted this in #help-forum
Open in Discord
Avatar
ginOP
So basically ive been dealing wit this since i resetted nginx completely. After this error socketio automatically switches to polling which works but its spamming the request tab :/ Do i need to modify some nginx configuration for it to be able to accept websockets for the reverse proxy?
Image

2 Replies

Avatar
ginOP
location /api/ {
        proxy_pass http://localhost:3004/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port $server_port;
        
        proxy_buffering off;
    }


reverse proxy block that the connection goes trough
for clarity:
Image