# Confused Reverse proxy and vaultwarden

**URL:** https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762
**Category:** General Discussion
**Created:** [24 September 2021 11:53 UTC](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762 "2021-09-24T11:53:36Z")
**Posts on this page:** 1
**Showing post:** 21

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 September 2021 20:29 UTC](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762/21 "2021-09-27T20:29:55Z")

</div>

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

```nohighlight
nano /mnt/dietpi_userdata/vaultwarden/vaultwarden.env

```

1. disable TLS

```nohighlight
#ROCKET_TLS={certs="./cert.pem",key="./privkey.pem"}

```

1. next to this I enabled websocket notifications

```nohighlight
WEBSOCKET_ENABLED=true
WEBSOCKET_ADDRESS=0.0.0.0
WEBSOCKET_PORT=3012

```

1. save the file and restart the service

```nohighlight
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

```nohighlight
nano /etc/lighttpd/conf-available/10-proxy.conf

```

1. add following

```nohighlight
$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

```nohighlight
lighty-enable-mod proxy
service lighttpd force-reload
systemctl restart lighttpd.service

```

1. now, vaultwarden should be reachable via [your.ddns.com](http://your.ddns.com)
2. testing with web browser and app was working fine,

---

_[View the full topic](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762)._
