Confused Reverse proxy and vaultwarden

One note for future readers who uses vaultwarden next to some other services like nextcloud:
You need to add /vault/ to your DOMAIN= in /mnt/dietpi_userdata/vaultwarden/vaultwarden.env, like:

DOMAIN=https://your.domain.net/vault/

if you also use $HTTP["url"] =~ "^/vault($|/)" { in your lighttpd config.
If you don’t add it in this case you will get a 404 error when you try to reach your vaultwarden instance.

Edit:

I think this needs to be also set for the notification hub $HTTP["url"] =~ "^/vault/notifications/hub($|/)" {
otherwise the service starts with an error message:

[vaultwarden::api::notifications][ERROR]
Dez 06 15:20:43 DietPi3B vaultwarden[1047523]:     ###########################################################
Dez 06 15:20:43 DietPi3B vaultwarden[1047523]:     '/notifications/hub' should be proxied to the websocket server or notifications won't work.
Dez 06 15:20:43 DietPi3B vaultwarden[1047523]:     Go to the Wiki for more info, or disable WebSockets setting WEBSOCKET_ENABLED=false.

3 Likes