Issue with NGINX reverse proxy and websockets

Hello,
I’m self-hosting a licensed instance of Bitwarden and am very happy with it. But I found out that something is wrong. The Browser Console shows a lot of connection errors, the Send Feature won’t work and I can’t use WebAuthn devices. Everything else seems to work.

There is a lack of documentation how to configure an Nginx revers proxy.

This tutorial here is indeed very frustrating, because is used three VMs and I only have one.

I fetch die SSL certs by myself.

Console errors:

[2023-07-26T14:53:04.968Z] Error: Failed to start the connection: Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled. Utils.ts:193:29
Unhandled Promise rejection: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled. ; Zone: <root> ; Task: null ; Value: Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.

Could you please provide an official Ngiunx revers proxy configuration and tell me what to do to get these websockets working? I’m an Linux professional and really don’t understand these things.

Are you running Nginx Reverse Proxy on the same Server or a different Virtual Machine ? Attach your Nginx Server Block in Code. I am running Bitwarden behind two Haproxy Load Balancers with no Nginx Reverse Proxy. But it should work.

Regards

Hi,

I’m sorry that the tutorial uses a different configuration to that which you’re using. All the required headings for using nginx as a reverse proxy with Bitwarden are present. You’ll simply need to change

   set $upstream https://192.168.1.44:443;

to wherever your Bitwarden server is accessible.

Feel free to open a ticket with us here if you need more assistance:

I am having a similar issue with bitwarden unified (docker w’ traefik)… while my browser connects fine to the websocket server when I log in manually:

WebSocket connected to wss://my_bw_url/notifications/hub?access_token=xxxxx

When I initiate log in with device, I am getting this error the moment I click on the “Log in with device” button (the push notification is sent):

Unhandled Promise rejection: 
"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled."
"; Zone:"
"<root>"
"; Task:"
null
"; Value:"
Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled. — 
(anonymous function) — WebSocketTransport.ts:129