Nginx log WS jitsi meet

Hi to all, i have a question about errors in nginx log about ws sessions, like this:

2022/01/25 10:18:31 [error] 1123#1123: *59790 recv() failed (104: Connection reset by peer) while proxying upgraded connection, client: 83.216.185.228, server: meet.er.cgil.it, request: "GET /xmpp-websocket?room=mo-primaesp22-286-incontro-in-videoconferenza-21-gennaio-2022 HTTP/1.1", upstream: "http://127.0.0.1:5280/xmpp-websocket?prefix=&room=mo-primaesp22-286-incontro-in-videoconferenza-21-gennaio-2022", host: "meet.er.cgil.it"```

my installation versions:

ii  jitsi-meet-prosody                     1.0.5675-1                            all          Prosody configuration for Jitsi Meet
ii  prosody                                0.11.11-1~focal1                      amd64        Lightweight Jabber/XMPP server

and jitsi

ii  jitsi-meet                             2.0.6726-1                            all          WebRTC JavaScript video conferences
ii  jitsi-meet-prosody                     1.0.5675-1                            all          Prosody configuration for Jitsi Meet
ii  jitsi-meet-turnserver                  1.0.5675-1                            all          Configures coturn to be used with Jitsi Meet
ii  jitsi-meet-web                         1.0.5675-1                            all          WebRTC JavaScript video conferences
ii  jitsi-meet-web-config                  1.0.5675-1                            all          Configuration for web serving of Jitsi Meet
ii  jitsi-videobridge2                     2.1-595-g3637fda4-1                   all          WebRTC compatible Selective Forwarding Unit (SFU)

I dont know why this problem happens i asked to some users and apparently all goes smoothly without problem in conferences.
Thanks in advance for helping me.

clients have 2 ways of connecting to Prosody: bosh and xmpp-websockets (to not be confused with jvb websockets). Bosh works ‘out of the box’, while xmpp-websockets require an additional configuration. You have probably enabled the websockets in your config.js without having completed the xmpp websockets configuration, so clients attempt to use xmpp-websockets, then after having failed, use bosh and succeed.
You can comment out the xmpp websocket instruction in the config.js and the error message will go away. Or you try to configure xmpp-websockets,

Thank @gpatel-fr for your answer i checked my xmpp-ws configuration against this thread https://community.jitsi.org/t/how-to-how-to-enable-websockets-xmpp-websocket-and-smacks-for-prosody/87920 and i can see that i configured correctly my system; i restart nginx and prosody and see tomorrow if errors gone

Hi @gpatel-fr i rechecked to day with my colleagues; i tested the url with curl like this

curl GET http://127.0.0.1:5280/xmpp-websocket

and i receive this output

<!DOCTYPE html><html><head><title>Websocket</title></head><body>
                        <p>It works! Now point your WebSocket client to this URL to connect to Prosody.</p>
                        </body></html>

I dont know if this is a good method to check that xmpp-websocket works but anyway…

In nginx error.log i can see xmpp-websocket error but not for all requests

2022/01/31 08:50:08 [error] 326798#326798: *20198 recv() failed (104: Connection reset by peer) while proxying upgraded connection, client: 77.89.31.206, server: meet.er.cgil.it, request: "GET /xmpp-websocket?room=im_esperti2022 HTTP/1.1", upstream: "http://127.0.0.1:5280/xmpp-websocket?room=im_esperti2022", host: "meet.er.cgil.it"

i can see that the GET is against http://127.0.0.1:5280/xmpp-websocket and in the nginx block i wrote http://loclahost:5280/xmpp-websocket

this is my nginx config:

    # BOSH
    location = /http-bind {
        proxy_pass       http://localhost:5280/http-bind;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

    # xmpp websockets
    location = /xmpp-websocket {
        proxy_pass http://localhost:5280/xmpp-websocket;
        add_header 'x-jitsi-shard' 'shard1';
        add_header 'x-jitsi-region' 'europe';
        add_header 'Access-Control-Expose-Headers' 'X-Jitsi-Shard, X-Jitsi-Region';
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        tcp_nodelay on;
        proxy_buffer_size 512k;
        proxy_buffers 16 512k;
        proxy_busy_buffers_size  512k;
    }

Thanks in advance for helping me.

sorry, but I don’t currently use xmpp-websockets, I’m not very well placed to help you here.

Thanks @gpatel-fr possibly may i ask to @damencho

Your nginx config looks correct to me. I would look at whats happening with prosody in /var/log/prosody/prosody.log

Also check /etc/prosody/conf.avail/<yourhost>.cfg.lua. You should have something listening on http:

http_ports = { 5280 }
http_interfaces = { "127.0.0.1" }

Hi @corby ,on test i changed the section of nginx sites-available meet.conf related to xmpp-websocket like this:

   # BOSH
    location = /http-bind {
        proxy_pass       http://localhost:5280/http-bind;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

    # xmpp websockets
    location = /xmpp-websocket {
        proxy_pass http://localhost:5280/xmpp-websocket;
        proxy_set_header X-Forwarded-For $proxy_protocol_addr;
        proxy_set_header x-jitsi-shard "shard_test";
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $http_host;
        proxy_buffer_size 512k;
        proxy_buffers 16 512k;
        proxy_busy_buffers_size  512k;
        tcp_nodelay on;

the section

proxy_set_header Connection $connection_upgrade;

and now no errors in nginx err.log. Is it correct?

Does it work?

Yes.