Confused Reverse proxy and vaultwarden

of course you can use docker and container like NginxProxyManager or traefik but it’s working without as well.

I did a test installation on 2 RPi. I used 2 devices just for testing. It’s fine to host web server as well as vaultwarden on a single device.

  1. created a DDNS domain from a free provider
  2. activate regular DDNS update using dietpi-ddns
  3. RPi 1 is hosting web server lighttpd
  4. RPi 2 is hosting vaultwarden
  5. on RPi 2 I was going to disable HTTPS on vaultwarden
nano /mnt/dietpi_userdata/vaultwarden/vaultwarden.env
  1. disable TLS
#ROCKET_TLS={certs="./cert.pem",key="./privkey.pem"}
  1. next to this I enabled websocket notifications
WEBSOCKET_ENABLED=true
WEBSOCKET_ADDRESS=0.0.0.0
WEBSOCKET_PORT=3012
  1. save the file and restart the service
systemctl restart vaultwarden.service
  1. vaultwarden is reachable on HTTP now
  2. on RPi 1 I executed dietpi-letsencrypt and was going to install certbot
  3. once done I requested SSL certificate for my DDNS domain and activate redirect HTTP > HTTPS
  4. lighttpd is already reachable on HTTP/HTTPS now
  5. SSL certificate will be automatically renewed if required by certbot
  6. add proxy code to lighttpd
nano /etc/lighttpd/conf-available/10-proxy.conf
  1. add following
$HTTP["host"] == "your.ddns.com" {
    $HTTP["url"] == "/notifications/hub" {
       # WebSocket proxy
       proxy.server  = ( "" => ("vaultwarden" => ( "host" => "192.168.0.x", "port" => 3012 )))
       proxy.forwarded = ( "for" => 1 )
       proxy.header = (
           "upgrade" => "enable",
           "connect" => "enable"
       )
    } else {
       proxy.server  = ( "" => ("vaultwarden" => ( "host" => "192.168.0.x", "port" => 8001 )))
       proxy.forwarded = ( "for" => 1 )
    }
}
  1. add correct DDNS host and IP address
  2. save file, activate setting and restart service
lighty-enable-mod proxy
service lighttpd force-reload
systemctl restart lighttpd.service
  1. now, vaultwarden should be reachable via your.ddns.com
  2. testing with web browser and app was working fine,
1 Like