High Performance backend behind HAProxy causing "Error: Websocket connection failed. Check browser console " Error

The Basics

  • Nextcloud Server version (e.g., 29.x.x): 31.0.1
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):
    • Rocky Linux 9.5
  • Web server and version (e.g, Apache 2.4.25):
    • 2.4.62
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • 1.22.1
  • PHP version (e.g, 8.3):
    • 8.3.19
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare Metal

Summary of the issue you are facing:

I have 2 nextcloud instances, an NFS Shared storage, a HAProxy Load balancer and High Performance Back End that I installed through this documentation “GitHub - sunweaver/nextcloud-high-performance-backend-setup

After installing the HPBE, i go the Talk app settings to fill the fields of “High Performance backend URL”, the shared secret, TURN server, STUN Server etc…

But Next to the “High-performance backend” field there is “Error: Websocket connection failed. Check browser console”.

And at first the web console was showing a Web Socket and CSP Error which I addressed with these setups
In the apache config of both servers
"Header unset Content-Security-Policy
Header unset Content-Security-Policy-Report-Only
Header always set Content-Security-Policy “default-src * data: blob: ‘unsafe-inline’ ‘unsafe-eval’”

and config.php or both servers
‘csp.domains’ => [ ‘connect-src’ => [‘self’, 'https://‘omitted’, ‘wss://omitted’], ‘worker-src’ => [‘self’, ‘blob:’] ],

And then changes to the ngnix server on the HPBE VM
“location /standalone-signaling/spreed {
proxy_pass http://127.0.0.1:8080/spreed;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
proxy_set_header Host $host;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
}”
And then I got a different error on the web console :

" Received error

Object { type: “error”, error: {…} }

SignalingStandaloneTest.js:92:13

onmessage SignalingStandaloneTest.js:92

close { target: WebSocket, isTrusted: true, wasClean: false, code: 1005, reason: “”, srcElement: WebSocket, eventPhase: 0, bubbles: false, cancelable: false, returnValue: true, … }

bubbles: false
cancelBubble: false
cancelable: false
code: 1005
composed: false
currentTarget: null
defaultPrevented: false
eventPhase: 0
explicitOriginalTarget: WebSocket { url: “wss://‘omitted’/standalone-signaling/spreed”, readyState: 3, bufferedAmount: 442, … }

isTrusted: true

originalTarget: WebSocket { url: “wss://omitted/standalone-signaling/spreed”, readyState: 3, bufferedAmount: 442, … }
reason: “”

returnValue: true

srcElement: WebSocket { url: “wss://omitted/standalone-signaling/spreed”, readyState: 3, bufferedAmount: 442, … }

target: WebSocket { url: “wss://omitted/standalone-signaling/spreed”, readyState: 3, bufferedAmount: 442, … }

timeStamp: 14206

type: “close”

wasClean: false

<get isTrusted()>: function isTrusted()

: CloseEventPrototype { wasClean: Getter, code: Getter, reason: Getter, … }
code:

constructor: function CloseEvent()

reason:

wasClean:


Symbol(Symbol.toStringTag): “CloseEvent”

​​
<get code()>: function code()

<get reason()>: function reason()

​​

<get wasClean()>: function wasClean()

​​

: EventPrototype { composedPath: composedPath(), stopPropagation: stopPropagation(), stopImmediatePropagation: stopImmediatePropagation(), … }

SignalingServer.vue:179:12"

I am sure I’m implementing websockets the wrong way but I’d like to know where and what I did wrong. Or maybe this isn’t even the way to do so.

The ultimate goal is to make the HPBE work and have ‘Talk’ perform well.

Thank you everyone.