Auto-sync not occuring (nginx+VW)

I got my VW instance up recently. Great so far! Trying debug some auto-sync problems.

I have the instance behind a nginx proxy. Logins, Organizations, new entries all fine. My Firefox browser addon, and my Android client do not auto-sync. Manual sync works fine on these.

Is there anything on the nginx or VW side that could cause this situation?

My server block looks like:

server {

    server_name vw.example.com; # managed by Certbot

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    location / {
        proxy_pass          http://localhost:8000;
        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;
    }

    location /notifications/hub {
        proxy_pass http://localhost:3012;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /notifications/hub/negotiate {
        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_pass http://localhost:8000;
    }
}

I can see entries like this:

bitwarden_1  | [2023-01-05 20:42:06.001][vaultwarden::api::notifications][INFO] Accepting WS connection from 172.21.0.1:46028
bitwarden_1  | [2023-01-05 20:43:17.453][vaultwarden::api::notifications][INFO] Accepting WS connection from 172.21.0.1:55480
bitwarden_1  | [2023-01-05 20:43:45.450][vaultwarden::api::notifications][INFO] Accepting WS connection from 172.21.0.1:42916

For each of these I see in the nginx logs an entry like

[05/Jan/2023:20:45:14 +0000] xxx.xxx.xxx.xxx - - - vw.example.com to: 127.0.0.1:3012: GET /notifications/hub?access_token=abc123...

I think these are from the Firefox addon. But they don’t seem to result in a sync.

You seem to be missing some config items, like forcing http 1.1.
Check Proxy examples · dani-garcia/vaultwarden Wiki · GitHub for the correct config.

Also, Android will never be able to auto sync, that isn’t support.

1 Like

Thanks a lot Dex!

All working now. Sorry didn’t see the wiki before. There are a lot of example out on the web that don’t appear to work.